Created
November 27, 2013 15:49
-
-
Save dland/7677920 to your computer and use it in GitHub Desktop.
Fun with Unicode
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/perl -l | |
use strict; | |
use utf8; | |
use open qw( :encoding(UTF-8) :std ); | |
use charnames qw( :full :short ); | |
my $word = "no\N{LATIN SMALL LETTER E WITH DIAERESIS}l"; | |
my $combine = "noe\N{COMBINING DIAERESIS}l"; | |
print uc $word; | |
print uc $combine; | |
print $word eq $combine ? 'same' : 'different'; | |
use Unicode::Normalize; | |
print NFD($word) eq NFD($combine) ? 'same' : 'different'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Produces