xeals / signal-back

Decrypt Signal encrypted backups outside the app
Apache License 2.0
704 stars 67 forks source link

Wrong encoding #28

Closed kostas888 closed 5 years ago

kostas888 commented 6 years ago

I am from russia. So, when I encrypte backup file, english text is ok, but all cyrylic text is wrong in hieroglyphs. And the encrypted file is in UCS-2 Little Endian, not in UTF-8. What's happening?

Windows 10 64bit.

kostas888 commented 6 years ago

?

xeals commented 6 years ago

I'm unable to reproduce this on Linux. I suspect this may be an issue in Windows. I'll try and make time to spin up a VM to confirm that idea.

xeals commented 6 years ago

Actually, does the problem persist if you use the -o flag instead of piping output from the program? There's a couple of articles around that suggest the Windows terminal doesn't like UTF-8, so it may be being mangled in the pipeline.

antonio-gil commented 6 years ago

Hi.

I was having the same issue, as my language is Spanish and I was having trouble getting the accentuated vowels (á, é, í, ó, ú) correctly. But after toying with the workaround mentioned here, and in #29 , I've managed to get those letters correctly, and the emojis too!

I'm using powershell as me default CLI, and I managed to get the correct result with this commands:

.\signal-back_windows_amd64.exe format -f XML .\signa-.backup | out-file "test.xml" -encoding oem

The trick was trying with the different encodings of the out-file Cmdlet.

These were the results:

image

image

Perhaps it isn't an elegant solution, but as long as it works ¯\_(ツ)_/¯...

By the way, this is the version of PowerShell that I have installed:

Major  Minor  Build  Revision
-----  -----  -----  --------
5      1      17134  228

And the current Culture (if it made some difference):

LCID             Name             DisplayName
----             ----             -----------
1033             en-US            English (United States)

Regards.

Edit: I completed the comment, as I pressed <Enter> by mistake...

kostas888 commented 6 years ago

@antonio-gil Thank you very much! Now it's ok!

antonio-gil commented 6 years ago

Glad to hear that, @kostas888 😃

xeals commented 5 years ago

The out-file Powershell cmdlet correctly handles UTF I would suspect. I'll mark this as closed unless the issue crops up again, and I'll add it to the wiki.