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

UTF8 encoding problem #52

Closed
MilosStanic opened this issue Jan 30, 2015 · 4 comments
Closed

UTF8 encoding problem #52

MilosStanic opened this issue Jan 30, 2015 · 4 comments

Comments

@MilosStanic
Copy link

I have implemented into my project the code from your example at https://github.com/auth0/angular-token-auth/

However, if the payload contains an UTF8 character, in my case 'ć' the payload is badly encoded, and I get an error when doing a JSON.parse of the payload, like I described here auth0-blog/angular-token-auth#9

@brianloveswords
Copy link

This was an issue in node-jws, I was using binary as the default encoding with no option to override. I just released v2.0.0 which changes the default to utf8 and gives the option to override the encoding.

@robertu7
Copy link

robertu7 commented Mar 2, 2015

Same problem with @MilosStanic , see below code:

var token = jwt.sign({
    username: '測試'
 }, key)

then when:

jwt.verify(token, key)

with error Unexpected token at JSON.parse.

@robertu7
Copy link

robertu7 commented Mar 2, 2015

@brianloveswords Awesome! 👍

@jfromaniello
Copy link
Member

It will be fixed on v4. Thank you guys!

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

4 participants