Skip to content

Instantly share code, notes, and snippets.

@kimmel
Created September 8, 2012 23:28
Show Gist options
  • Save kimmel/3681026 to your computer and use it in GitHub Desktop.
Save kimmel/3681026 to your computer and use it in GitHub Desktop.
decode_json() takes a binary encoded string
#!/usr/bin/perl
use v5.14;
use warnings;
use utf8::all;
use Encode;
use Data::Dumper;
use JSON::XS qw( decode_json );
my $wl = '{"creche":"crèche", "¥":"£", "₡":"волн"}';
my $pattern_list = decode_json( encode("utf8", $wl) );
print Dumper $pattern_list;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment