freebsd-ports/sysutils/uniutils/files/patch-utf8lookup
Thierry Thomas 477b012142 - Fix hard-coded endian assumption;
- Change /usr/local replacement from LOCALBASE -> PREFIX.

PR:		ports/203706
Submitted by:	John Hein <z7dr6ut7gs (at) snkmail.com>
2015-10-24 16:48:48 +00:00

14 lines
579 B
Text

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