Skip to content

Mojo::Util: punycode encoding/decoding doesn't roundtrip #2287

@karenetheridge

Description

@karenetheridge
use v5.42;
use utf8;
use open ':std', ':encoding(UTF-8)';
use Mojo::Util 'punycode_encode', 'punycode_decode';

say "encoded ☃⭐️ -> ", punycode_encode("☃⭐️");
say "roundtrips to -> ", punycode_decode(punycode_encode("☃⭐️"));

prints:

encoded ☃⭐️ -> g7ix603e
roundtrips to -> ︑⭑

These characters are:

  • U+2603 - snowman
  • U+2b50 - star

Picking through exactly what is going wrong is tricky though!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions