freebsd-ports/sysutils/uniutils/files/patch-utf8lookup

15 lines
579 B
Text
Raw Normal View History

--- 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