AutomatedOutlookSignature icon indicating copy to clipboard operation
AutomatedOutlookSignature copied to clipboard

Arabic Text Encoding in Signature Generation

Open sheesetfs opened this issue 1 year ago • 1 comments

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 avatar Dec 12 '23 06:12 sheesetfs

@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)

NikPPPPPP avatar Mar 14 '24 13:03 NikPPPPPP

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.

captainqwerty avatar May 20 '24 17:05 captainqwerty

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.

captainqwerty avatar May 22 '24 19:05 captainqwerty