mirror of
https://github.com/octoleo/telegram-bot-bash.git
synced 2024-05-29 00:10:53 +00:00
fix case problem with bash JsonDecode
This commit is contained in:
parent
10415846d9
commit
6be706b571
|
@ -10,7 +10,7 @@
|
||||||
# This file is public domain in the USA and all free countries.
|
# This file is public domain in the USA and all free countries.
|
||||||
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
|
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
|
||||||
#
|
#
|
||||||
#### $$VERSION$$ v0.6-rc1-0-gc001d14
|
#### $$VERSION$$ v0.6-rc1-2-g1041584
|
||||||
#
|
#
|
||||||
# Exit Codes:
|
# Exit Codes:
|
||||||
# - 0 sucess (hopefully)
|
# - 0 sucess (hopefully)
|
||||||
|
@ -592,7 +592,7 @@ else
|
||||||
JsonDecode() {
|
JsonDecode() {
|
||||||
local out="$1"
|
local out="$1"
|
||||||
local remain=""
|
local remain=""
|
||||||
local regexp='(.*)\\ud([0-9a-fA-F]{3})\\ud([0-9a-fA-F]{3})(.*)'
|
local regexp='(.*)\\u[dD]([0-9a-fA-F]{3})\\u[dD]([0-9a-fA-F]{3})(.*)'
|
||||||
while [[ "${out}" =~ $regexp ]] ; do
|
while [[ "${out}" =~ $regexp ]] ; do
|
||||||
local W1="$(( ( 0xd${BASH_REMATCH[2]} & 0x3ff) <<10 ))"
|
local W1="$(( ( 0xd${BASH_REMATCH[2]} & 0x3ff) <<10 ))"
|
||||||
local W2="$(( 0xd${BASH_REMATCH[3]} & 0x3ff ))"
|
local W2="$(( 0xd${BASH_REMATCH[3]} & 0x3ff ))"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user