summaryrefslogtreecommitdiff
path: root/sysutils/uniutils/files/patch-utf8lookup
blob: 12bf96dc0d1e2466a5ded61f055d72b7e1183386 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
--- utf8lookup.orig	2007-06-30 05:31:37 UTC
+++ utf8lookup
@@ -8,9 +8,10 @@
 #       UTF-32   name
 #	000543   ARMENIAN CAPITAL LETTER CHEH
 #
+[ $(( $(printf '\1' | od -dAn) )) -eq 1 ] && end=le || end=be
 echo 0x$1 |		 # feed command-line argument to ascii2binary's stdin
 ascii2binary -t ui |	 # convert text to unsigned integer
-iconv -f utf32 -t utf8 | # convert utf-32 to utf-8 encoding
+iconv -f ucs-4$end -t utf-8 | # convert utf-32 to utf-8 encoding
 uniname -b -c -e -g      # feed to uniname, suppressing byte and character offsets,
 			 # UTF-8 encoding, and glyph