Skip to content

Instantly share code, notes, and snippets.

@dland

dland/unicode

Created Nov 27, 2013
Embed
What would you like to do?
Fun with Unicode
#! /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';
@dland

This comment has been minimized.

Copy link
Owner Author

@dland dland commented Nov 27, 2013

Produces

NOËL
NOËL
different
same
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment