AutomatedOutlookSignature
AutomatedOutlookSignature copied to clipboard
Arabic Text Encoding in Signature Generation
Problem:
The Set-OutlookSignature.ps1 script encounters difficulties in handling Arabic names and titles during the signature generation process. When users with Arabic names or titles log in, the script saves the Arabic text as "?" in the generated signature file.
Issue Details:
Character Encoding: The script appears to struggle with proper character encoding for Arabic text, resulting in the substitution of Arabic characters with "?" in the signature. User Impact: Users with Arabic names or titles may experience inaccurate representation of their information in the generated signature, leading to a lack of personalization and potential miscommunication.
@sheesetfs
Possible Solution:
Explanation: Not every character is available in ASCII. Every character which is not available in ASCII is marked as '?' Thus instead use the more modern UTF-8 encoding. This should work for most characters.
Link to ASCII Character Table Link to UTF-8 Character Table
In HTML:
Use <meta charset='UTF-8'>
in Header of HTML Part
For the Output File for HTML:
Use
$style + $signature | Out-File -FilePath "$file.htm" -Encoding utf8
instead of
$style + $signature | Out-File -FilePath "$file.htm" -Encoding ascii
If this does not work use:
$htmlcontent = $style + $signature
$filepath = "$file.htm"
[System.IO.File]::WriteAllText($filepath, $htmlcontent)
For the Text File:
Use
$signature | Out-File "$file.txt" -Encoding utf8
instead of
$signature | Out-File "$file.txt" -Encoding ascii
If this does not work use:
$signature | Out-File "$file.txt" -Encoding utf8
$filepath = "$file.txt"
[System.IO.File]::WriteAllText($filepath, $signature)
Hello,
@sheesetfs - please would you consider moving to the latest release (5.0.0) I have added a launch parameter -encoding where you can set the encoding recommended by @NikPPPPPP (Thank you for this)
Please can you let me know if this resolves your issue.
Thank you.
UTF-8 Encoding is the default in version 5.0.1 which is in development branch. Version 5.0.0 which is released has -encoding parameter to pick from a small amount of different encoding options for now.