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

Base32.decode() doesn't work on international alphabet #20

Open
alexreyes opened this issue Jun 21, 2017 · 3 comments
Open

Base32.decode() doesn't work on international alphabet #20

alexreyes opened this issue Jun 21, 2017 · 3 comments

Comments

@alexreyes
Copy link

This works fine for some strings, but for examples like these I get invalid results:

base32.encode("юзер@екзампл.ком.example.com");

output:

9rvundefinedag206mxundefinedecundefinedw7wxjweundefinedy7gq6ay31dnr6rt9ecdqp

input:

base32.decode(9rvundefinedag206mxundefinedecundefinedw7wxjweundefinedy7gq6ay31dnr6rt9ecdqpu");

results in:

N7ªµÏ\Õ@@5;ªµÏ\×3Uk¹¼?;.;Uk¹¾<.example.com

As you can see, it does not result in the original string when it is decoded. Not sure why.

@agnoster
Copy link
Owner

Yeah, this issue has come up before - it doesn't handle non-ascii data well, which is totally a shortcoming. I just haven't really updated this package in forever - I kind of made it as a proof-of-concept and haven't touched it in a long time. I'm happy to accept a PR to fix this though.

@ignoramous
Copy link

ignoramous commented Jan 9, 2020

Yeah, this issue has come up before - it doesn't handle non-ascii data well, which is totally a shortcoming.

Can you please add that as a disclaimer in the readme and the npm page? Not being able to handle non-ascii data is important since primary use case for such encoding is precisely so that the Unicode characters can be made digestible by various data-structures and clients.

@alexreyes
Copy link
Author

Okay, I think you're right about that @ignoramous. I made a PR to include this in the readme (I'm not the maintainer of this project)

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

3 participants