Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Telegram notifications appear garbled when they contain Chinese #34

Open
yiqixueba56 opened this issue Jun 8, 2024 · 13 comments
Open

Comments

@yiqixueba56
Copy link

yiqixueba56 commented Jun 8, 2024

When the duplicacy backup path contains Chinese characters, the printed log can display Chinese characters normally, but the telegram notification displays garbled characters.
image
image
image

@TheBestPessimist
Copy link
Owner

Thank you for taking your time to create this issue. Could you please upload the log file created by duplicacy-utils? I hope that will help me figure out what the problem is. (I expect it's some encoding problem, but i'm not sure).

@yiqixueba56
Copy link
Author

backup-log 2024-06-09 10-33-29_638535260094458980.log
I can't find the generated log, I'm regenerating the log now。
image
image
image
image

@TheBestPessimist
Copy link
Owner

Thank you. I will check it out tomorrow. (Today's a traveling day)

@TheBestPessimist TheBestPessimist changed the title Telegraph notifications appear garbled when they contain Chinese Telegram notifications appear garbled when they contain Chinese Jun 9, 2024
@yiqixueba56
Copy link
Author

Wishing you a pleasant journey and all the best!

@TheBestPessimist
Copy link
Owner

TheBestPessimist commented Jun 10, 2024

This will prove hard to debug. it works on my machine:

image

(yes, i noticed that there's some garbled characters in the error log. I believe that's irrelevant)

@TheBestPessimist
Copy link
Owner

TheBestPessimist commented Jun 10, 2024

@yiqixueba56 can you please open powershell give me the output of:

$OutputEncoding

For reference, here is what i have

PowerShell 7.4.1

   A new PowerShell stable release is available: v7.4.2
   Upgrade now, or check out the release page at:
     https://aka.ms/PowerShell-Release?tag=v7.4.2

PS C:\Users\TheBestPessimist> $OutputEncoding

Preamble          :
BodyName          : utf-8
EncodingName      : Unicode (UTF-8)
HeaderName        : utf-8
WebName           : utf-8
WindowsCodePage   : 1200
IsBrowserDisplay  : True
IsBrowserSave     : True
IsMailNewsDisplay : True
IsMailNewsSave    : True
IsSingleByte      : False
EncoderFallback   : System.Text.EncoderReplacementFallback
DecoderFallback   : System.Text.DecoderReplacementFallback
IsReadOnly        : True
CodePage          : 65001

PS C:\Users\TheBestPessimist>

@TheBestPessimist
Copy link
Owner

Btw, maybe its easier to communicate directly on telegram, for some quick back and forth, if you're willing to further help me.
https://t.me/TheBestPessimist

@yiqixueba56
Copy link
Author

yiqixueba56 commented Jun 10, 2024

PS C:\Users\86152> $PSVersionTable
Name                           Value
----                           -----
PSVersion                      5.1.19041.4291
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.19041.4291
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

PS C:\Users\86152> $OutputEncoding
IsSingleByte      : True
BodyName          : us-ascii
EncodingName      : US-ASCII
HeaderName        : us-ascii
WebName           : us-ascii
WindowsCodePage   : 1252
IsBrowserDisplay  : False
IsBrowserSave     : False
IsMailNewsDisplay : True
IsMailNewsSave    : True
EncoderFallback   : System.Text.EncoderReplacementFallback
DecoderFallback   : System.Text.DecoderReplacementFallback
IsReadOnly        : True
CodePage          : 20127
PS C:\Users\86152>

@yiqixueba56
Copy link
Author

Btw, maybe its easier to communicate directly on telegram, for some quick back and forth, if you're willing to further help me. https://t.me/TheBestPessimist

I'm very happy to help!

@yiqixueba56
Copy link
Author

Is the PowerShell encoding format set to US-ASCII, which causes garbled characters? It should be set to utf-8, right?

@TheBestPessimist
Copy link
Owner

I'm not sure. maybe.

Put this command

$PSDefaultParameterValues['*:Encoding'] = 'utf8'

in the file backup.ps1 and let's cross our fingers:

image

Alternatively, you can put that command directly in the powershell profile file, but maybe that's more difficult.

In order to test the encoding, that command must run each time

@TheBestPessimist
Copy link
Owner

even after setting the encoding to utf8, the issue still happens, so something else might be wrong.

@yiqixueba56
Copy link
Author

yiqixueba56 commented Jun 10, 2024

add this command

$PSDefaultParameterValues['*:Encoding'] = 'utf8'

the issue still happens.
image
image

PS C:\Users\86152> $OutputEncoding

BodyName          : utf-8
EncodingName      : Unicode (UTF-8)
HeaderName        : utf-8
WebName           : utf-8
WindowsCodePage   : 1200
IsBrowserDisplay  : True
IsBrowserSave     : True
IsMailNewsDisplay : True
IsMailNewsSave    : True
IsSingleByte      : False
EncoderFallback   : System.Text.EncoderReplacementFallback
DecoderFallback   : System.Text.DecoderReplacementFallback
IsReadOnly        : True
CodePage          : 65001

PS C:\Users\86152>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants