mathiasbynens / mathiasbynens/punycode.js

`toASCII` returns incorrect result

Open
#66 5 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
JavaScript
Stars
1.7k
Forks
170
PR merge metrics
No merged PRs in 30d

Description

While converting various emojis, I've found that very often it is not converting them correctly.

**What I'd expect:**
1.` punycode.toASCII( "❄️🙊" )` should equal "xn--tdix719m" where instead it equals "xn--tdiy444e5vxg" (invalid punycode)
2. `punycode.toASCII( "👰✉️" )` should equal "xn--4bi6168m" where instead it equals "xn--4biw254ehqwg" (invalid punycode)

I could give many more examples, but I haven't found a pattern in the mistake.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the two punycode.toASCII examples in the issue and compare the returned strings with the expected values. Investigate the emoji conversion path and RFC 3492/RFC 5891 compliance; done means the reported cases and additional emoji examples produce correct, valid Punycode results.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.