-
Notifications
You must be signed in to change notification settings - Fork 2
/
unicode.functions
22 lines (18 loc) · 992 Bytes
/
unicode.functions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# This file is part of shellfire unicode. It is subject to the licence terms in the COPYRIGHT file found in the top-level directory of this distribution and at https://raw.githubusercontent.com/shellfire-dev/unicode/master/COPYRIGHT. No part of shellfire unicode, including this file, may be copied, modified, propagated, or distributed except according to the terms contained in the COPYRIGHT file.
# Copyright © 2014-2015 The developers of shellfire unicode. See the COPYRIGHT file in the top-level directory of this distribution and at https://raw.githubusercontent.com/shellfire-dev/unicode/master/COPYRIGHT.
_unicode_writeByte()
{
printf "\\$(printf '%o' $1)"
}
_unicode_writeUnsignedShortBigEndian()
{
local unsignedShort=$1
_unicode_writeByte $((unsignedShort >> 8))
_unicode_writeByte $((unsignedShort & 65280))
}
_unicode_writeUnsignedShortLittleEndian()
{
local unsignedShort=$1
_unicode_writeByte $((unsignedShort & 65280))
_unicode_writeByte $((unsignedShort >> 8))
}