Re: [BUGS] control character check in JSON type seems broken

2012-06-09 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: On Mon, Jun 4, 2012 at 8:48 PM, Tom Lane t...@sss.pgh.pa.us wrote: And so is that.  IMO the error reporting in this module could stand to be reviewed altogether for compliance with our message guidelines. (For starters, why is it using

Re: [BUGS] control character check in JSON type seems broken

2012-06-08 Thread Robert Haas
On Mon, Jun 4, 2012 at 8:48 PM, Tom Lane t...@sss.pgh.pa.us wrote: In addition, error message above seems corrupted in my environment. Here we check not-escaped control character, so printing it with %c formatting might break log files.  How about using decimal or hex dump in such cases? And

[BUGS] control character check in JSON type seems broken

2012-06-04 Thread Shigeru Hanada
Hi, A Japanese user found strange behavior in JSON type, so I'd like to share the issue here. He simply tested casting a string literal to json type, and got an unexpected error when he used a Japanese word as name and/or value of JSON object. In the example below, キー is a Japanese word which

Re: [BUGS] control character check in JSON type seems broken

2012-06-04 Thread Tom Lane
Shigeru Hanada shigeru.han...@gmail.com writes: json_lex_string() misjudges that the token キー contains naked (not-escaped) control character, because its first byte is 0xe3 and it's -29 for signed char interpreting, and it's less than 32. We need to cast to unsigned char (or use unsigned