rsyslog / liblognorm

a fast samples-based log normalization library
http://www.liblognorm.com
GNU Lesser General Public License v2.1
99 stars 64 forks source link

error encode unicode message #208

Closed zhanglong2005 closed 8 years ago

zhanglong2005 commented 8 years ago

liblognorm can't correct encode original chinese unide. like this example:

input text: otspc,10.2.240.72,20160613233647,zhanglon张g,0A02F04898F4F3E6574C635798DD5B5BA3B57A2FFB

rules: rule=:abc

output.txt: { "originalmsg": "otspc,10.2.240.72,20160613233647,zhanglon\u00E50.0g,0A02F04898F4F3E6574C635798DD5B5BA3B57A2FFB"}

you can see that the chinese character:张 is encode to \u00E50.0,this is not the correct unicode,the correct unicode is \u5f20.

I thinks this is a libfastjson bug.But i am not sure that.

rgerhards commented 8 years ago

Yes, this is libfastjson bug, which is fixed in 0.99.3.

beave commented 8 years ago

Thanks Rainer...