alfred-devtoys icon indicating copy to clipboard operation
alfred-devtoys copied to clipboard

Base64 encryption and decryption error when special characters

Open MyPuppet opened this issue 3 years ago • 1 comments

When I use encode to encrypt "Ö", the result is "T8yI", and when I use decode to decrypt, the value becomes "Ö".

We can't see the problem with our eyes, I'll use an example to prove this wrong.

截屏2022-08-17 10 52 59 截屏2022-08-17 10 53 22 截屏2022-08-17 10 54 55 截屏2022-08-17 10 55 03

When using base64encode, the encoded result is "1g==", and the decrypted result is also correct, you can use this as a reference.

Thank you for your efforts, overall this is a great project.

MyPuppet avatar Aug 17 '22 03:08 MyPuppet

CleanShot 2022-08-18 at 20 43 53-trimmed

20:44:13 workflow.go:328: ---------- DevToys/1.4.0 (AwGo/0.27.1) -----------
20:44:13 encode.go:30: Ö
20:44:13 encode.go:35: not same with clipboard
20:44:13 encode.go:36: [79 204 136] 
20:44:13 encode.go:37: [195 150] 
20:44:13 update.go:210: 1h21m16.181449s since last check for update
20:44:13 update.go:198: latest version: 1.4.0
20:44:13 feedback.go:509: Sent 3 result(s) to Alfred
20:44:13 workflow.go:405: ------------------ 14.259089ms -------------------

as above encode.go:36 / encode.go:37 show that manual input Ö is different byte array with directly read from clipboard. root cause is Ö is special characters. I might NOT have time to handle special characters recently.

cage1016 avatar Aug 18 '22 13:08 cage1016