jsawk icon indicating copy to clipboard operation
jsawk copied to clipboard

Support non-ASCII characters

Open shrx opened this issue 10 years ago • 4 comments

Non-ASCII sharacters don't parse correctly:

$ cat test.txt                    
["čšž"]
$ cat test.txt|jsawk
["čšž"]

shrx avatar Nov 30 '15 11:11 shrx

Debian 2.6.39 ii spidermonkey-bin 1.9.1.16-20 cat /tmp/t | jsawk 'this.age++' [{"first":"алалал","last":"345345пвапва","from":"england","age":53,"sports":["rugby","badmitton","snooker"]}]


Debian 4.2.0 ii libmozjs-24-dev 24.2.0-2 cat /tmp/t | jsawk 'this.age++' [{"first":"алалал","last":"345345пвапва","from":"england","age":53,"sports":["rugby","badmitton","snooker"]}]

libmozjs don't working correctly?

gizmo174 avatar Dec 01 '15 12:12 gizmo174

I have libmozjs-24-dev 24.2.0-3ubuntu1.

shrx avatar Dec 01 '15 21:12 shrx

I have added a possible fix for this in the pull request (not thoroughly tested but it works for me)

shrx avatar Dec 02 '15 13:12 shrx

shrx, Thank you help me ps: if need use an after script (-a option) then use cat ./test | jsawk -a 'return decodeURIComponent(escape(this[0].name))'

gizmo174 avatar Dec 03 '15 06:12 gizmo174