mirror of
https://github.com/dankamongmen/notcurses
synced 2025-03-09 09:09:03 -04:00
mojibake: add all unicode 13 emoji via CLDR order #770
This commit is contained in:
parent
b6330d142b
commit
fd83cc8639
3452
src/demo/mojibake.c
3452
src/demo/mojibake.c
File diff suppressed because it is too large
Load Diff
19
tools/emojiprep.sh
Executable file
19
tools/emojiprep.sh
Executable file
@ -0,0 +1,19 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# Used to generate C constants from a Unicode Consortium
|
||||||
|
# emoji-ordering-rules.txt data file. This is done to build
|
||||||
|
# the mojibake demo C file.
|
||||||
|
|
||||||
|
usage() { echo "usage: `basename $0` < emoji-ordering-rules.txt" ; }
|
||||||
|
|
||||||
|
[ "$#" -eq 0 ] || { usage >&2 ; exit 1 ; }
|
||||||
|
|
||||||
|
while read line ; do unicode --brief --max 100 $line | cut -d\ -f2 | \
|
||||||
|
sed -e 's/U+\(.....\)/\\U000\1/' | \
|
||||||
|
sed -e 's/U+\(....\)/\\u\1/' | \
|
||||||
|
sed -e ':a; /u200D$/N; s/u200D\n/u200D/; ta' | \
|
||||||
|
sed -e ':a; $!N;s/\n\\u200D/\\u200D/;ta;P;D' | \
|
||||||
|
sed -e 's/\(.*\)/"\1"/'
|
||||||
|
done
|
Loading…
x
Reference in New Issue
Block a user