Skip to content

Instantly share code, notes, and snippets.

@hamakn
Last active August 29, 2015 14:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hamakn/8aa8e92e39018a3e62ed to your computer and use it in GitHub Desktop.
Save hamakn/8aa8e92e39018a3e62ed to your computer and use it in GitHub Desktop.
wave dash
use strict;
use warnings;
use utf8;
use Encode;
# 波ダッシュ
my $wavedash = chr(hex "301c");
print encode_utf8($wavedash) . "\n";
# => "〜"
# 全角チルダ
my $tilde = chr(hex "FF5E");
print encode_utf8($tilde) . "\n";
# => "~"
$wavedash eq $tilde ? print "1\n" : print "0\n";
# => 0
# 波ダッシュ
wavedash = "301C".to_i(16).chr('UTF-8')
p wavedash
# => "〜"
# 全角チルダ
tilde = "FF5E".to_i(16).chr('UTF-8')
p tilde
# => "~"
p wavedash == tilde
# => false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment