-
Notifications
You must be signed in to change notification settings - Fork 159
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
punycode.encode('♡.com') should return 'xn--c6h.com' but instead it returns '.com-ku3b' #117
Comments
Correction: The shell had POSIX
and now I switched to en_US.UTF-8, and the output is "c6h" which is close, but why doesn't it show as "xn--c6h" instead? Also I found the tr46 module which seems to be better. |
I'm quite new to the work of "punycode" and so my comment here might not make much sense, I'm sorry for that. I have the same behaviour when using within a Typescript project in the frontend. I've checked and my file is indeed in UTF-8. I'm not sure if it should return @jasonkhanlar where you able to have it work? Where you using it in the command line or in a NodeJS application? |
@alveshelio I don't remember, but in my project I switched to using xmlbuilder, despite encountering oozcitak/xmlbuilder2#117 and concluding with my own work-around for my project use case scenario oozcitak/xmlbuilder2#131. Also other than that minor hiccup, I found it to be a beautifully wonderful library and I appreciate the devs that made it! |
Hey Jason, Thank you for getting back. I guess I'll have to search for something else :) Cheers |
new URL("https://♡.com").href |
@AlttiRi Great solution! Is there any tricky way to reverse this function? I mean from punycode to Unicode? |
You should use > (await import("punycode")).toASCII("♡.com")
'xn--c6h.com' |
punycode.encode('♡.com') should return 'xn--c6h.com' but instead it returns '.com-ku3b'
The text was updated successfully, but these errors were encountered: