BUG: errors handling unicode emoji
veesahni opened this issue · comments
Route Node Version: 4.1.1
Node Version: 12.16.3
Reproducible code:
const rootNode = new RouteNode('', '', [new RouteNode('users', '/users?:q')])
console.log(rootNode.buildPath('users', { q: 'test漢字' }))
// outputs: /users?q=test%E6%BC%A2%E5%AD%97
console.log(rootNode.buildPath('users', { q: '60ad50🚀' }))
// outputs: /users?q=60ad50%F0%9F%9A%80
rootNode.setPath('/')
console.log(rootNode.buildPath('users', { q: 'test漢字' }))
// outputs: /users?q=test%E6%BC%A2%E5%AD%97
console.log(rootNode.buildPath('users', { q: '60ad50🚀' }))
// EXCEPTION: Uncaught URIError: URI malformed
Discussion:
- Library seems to handle international unicode characters just fine but fails on emoji
- Additionally, it only fails if path is set
Is there any chance this might get fixed in a future release?