Skip to content
This repository has been archived by the owner on Sep 28, 2018. It is now read-only.

Decode to =?GB18030?B?lDnaMw==?=: failed #49

Closed
lygstate opened this issue Jan 14, 2016 · 4 comments
Closed

Decode to =?GB18030?B?lDnaMw==?=: failed #49

lygstate opened this issue Jan 14, 2016 · 4 comments

Comments

@lygstate
Copy link

The following GB18030 decode incorrect.
=?GB18030?B?lDnaMw==?=:

@inexorabletash
Copy link
Owner

Can you provide the error as a code sample? I'm not sure how you intend that string to be interpreted. (As a sequence of ASCII bytes? etc)

@inexorabletash
Copy link
Owner

No feedback, closing.

@Artoria2e5
Copy link

This is an RFC 2047 "encoded-word", written in the "B" (base64) encoding. So it's basically:

new TextDecoder('gb18030').decode(
    Uint8Array.from(
        atob('lDnaMw=='), 
        (ch) => (ch.codePointAt(0))))
// "💩"
@inexorabletash
Copy link
Owner

Thanks for providing the repro!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
3 participants