From 63b7b8e783578afd8034e1bf56abe73f3e329ab4 Mon Sep 17 00:00:00 2001 From: IIMarckus Date: Wed, 21 Dec 2011 00:12:36 -0700 Subject: Add support for Unicode, and use it to put in ♀ and ♂. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit hg-commit-id: a482b0ef7a01 --- textpre.awk | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'textpre.awk') 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 "," -- cgit v1.3.1-sl0p