diff options
author | IIMarckus <iimarckus@gmail.com> | 2011-12-21 00:12:36 -0700 |
---|---|---|
committer | IIMarckus <iimarckus@gmail.com> | 2011-12-21 00:12:36 -0700 |
commit | 63b7b8e783578afd8034e1bf56abe73f3e329ab4 (patch) | |
tree | 7b54ca731a512b97b5287ba6d0b8fe17ea28bdcb /textpre.awk | |
parent | 35a33bf3d73e376f8d2c7f0871c56c4aac06fcca (diff) |
Add support for Unicode, and use it to put in ♀ and ♂.
hg-commit-id: a482b0ef7a01
Diffstat (limited to 'textpre.awk')
-rw-r--r-- | textpre.awk | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/textpre.awk b/textpre.awk index eea16c63..5518591e 100644 --- a/textpre.awk +++ b/textpre.awk @@ -67,8 +67,10 @@ char["-"] = "$E3" char["?"] = "$E6" char["!"] = "$E7" char["."] = "$E8" +char["♂"] = "$EF" char["/"] = "$F3" char[","] = "$F4" +char["♀"] = "$F5" char["0"] = "$F6" char["1"] = "$F7" char["2"] = "$F8" @@ -98,6 +100,16 @@ else { while (f != "") { c = substr(f,1,1) f = substr(f,2,length(f) - 1) + if (c > "𐀀") { # U+10000 + c = c substr(f,1,3) + f = substr(f,4,length(f) - 3) + } else if (c > "ࠀ") { # U+0800 + c = c substr(f,1,2) + f = substr(f,3,length(f) - 2) + } else if (c > "") { # U+0080 + c = c sustr(f,1,1) + f = substr(f,2,length(f) - 1) + } print char[c] if (length(f)) print "," |