oliverschwendener / ueli

Cross-Platform Keystroke Launcher
https://ueli.app
MIT License
3.66k stars 242 forks source link

fix: Use "utf8" encoding for Buffer on Base64 conversion #1176

Closed ykhrito closed 2 months ago

ykhrito commented 2 months ago

Encoding specified for Buffer on Base64 Conversion should be “utf8”, not “binary”. This causes that non-ASCII characters, Emoji, etc... are not encoded/decoded correctly.

For example: "thumbs-up"👍should be encoded as "8J+RjQ=="

# using coreutils on Linux shell
$ printf 👍 | base64
8J+RjQ==

but Base64 Conversion result: image

This PR fix would make the following result: image

oliverschwendener commented 2 months ago

@ChristopherSteiner

oliverschwendener commented 2 months ago

@ykhrito Please add a test case for this.

ykhrito commented 2 months ago

I've added test cases, please check it out.

oliverschwendener commented 2 months ago

@ChristopherSteiner If this is good for you, I'll merge it.

ChristopherSteiner commented 2 months ago

Yes looks good! Go ahead please

oliverschwendener commented 2 months ago

@ChristopherSteiner Thanks for accepting the invite. Next time you get assigned as reviewer automatically.