Lines 1-11
Link Here
|
1 |
--- utf8lookup.orig Sun Jan 29 21:43:23 2006 |
1 |
--- utf8lookup.orig Sun Jan 29 21:43:23 2006 |
2 |
+++ utf8lookup Tue Jan 31 00:11:48 2006 |
2 |
+++ utf8lookup Tue Jan 31 00:11:48 2006 |
3 |
@@ -10,7 +10,7 @@ |
3 |
@@ -10,7 +10,8 @@ |
4 |
# |
4 |
# |
|
|
5 |
+[ $(( $(printf '\1' | od -dAn) )) -eq 1 ] && end=le || end=be |
5 |
echo 0x$1 | # feed command-line argument to ascii2binary's stdin |
6 |
echo 0x$1 | # feed command-line argument to ascii2binary's stdin |
6 |
ascii2binary -t ui | # convert text to unsigned integer |
7 |
ascii2binary -t ui | # convert text to unsigned integer |
7 |
-iconv -f utf32 -t utf8 | # convert utf-32 to utf-8 encoding |
8 |
-iconv -f utf32 -t utf8 | # convert utf-32 to utf-8 encoding |
8 |
+iconv -f ucs-4le -t utf-8 | # convert utf-32 to utf-8 encoding |
9 |
+iconv -f ucs-4$end -t utf-8 | # convert utf-32 to utf-8 encoding |
9 |
uniname -b -c -e -g # feed to uniname, suppressing byte and character offsets, |
10 |
uniname -b -c -e -g # feed to uniname, suppressing byte and character offsets, |
10 |
# UTF-8 encoding, and glyph |
11 |
# UTF-8 encoding, and glyph |
11 |
|
12 |
|