Last active
August 29, 2015 14:15
-
-
Save hamakn/8aa8e92e39018a3e62ed to your computer and use it in GitHub Desktop.
wave dash
This file contains 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
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 |
This file contains 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
# 波ダッシュ | |
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