| Age | Commit message (Collapse) | Author |
|
|
|
Also made json_delete a little less confusing (but it still uses gotos).
|
|
|
|
|
|
|
|
Note that this is currently untested with server encodings other than UTF-8.
The encoding policy used is: JSON nodes and most of the JSON functions still
operate in UTF-8. Strings are converted between server encoding and UTF-8
when they go in and out of varlena (text*), and a set of helper functions
are implemented to make these conversions simple to apply.
It is done this way because converting individual codepoints to/from whatever
the server encoding may be is nontrivial (possibly requires a loaded module).
The JSON code needs to encode/decode codepoints when it deals with escapes.
Although a more clever and efficient solution might be to defer charset
conversions to when they're necessary (e.g. round up all the escapes
and encode them all at once), this is not simple, and it's probably not much
more efficient, either. Conversions to/from server encoding and UTF-8
are no-ops when the server encoding is UTF-8, anyway.
|
|
PostgreSQL's pg_wchar.h routines.
* Touched up various functions' documentation.
json_node's are currently encoded in UTF-8, and the JSON module is not
100% compatible with arbitrary server encodings yet. I plan to switch
from UTF-8 to the server encoding pretty soon, after which JSON should be
a well-behaved datatype as far as charsets go.
|
|
* Removed json_cleanup and json_validate_liberal.
json_cleanup was badly in need of a rewrite.
|
|
pg_indent again).
|
|
* Reworked json_node::orig so it can handle replacing the key or value
without altering surrounding formatting.
* json_encode (C function) is now recursive (its stack usage depends
on the depth of input). This was done because json_encode cannot rely
on nodes' ->parent fields being trustworthy, as json_replace_value
assigns JSON nodes by reference.
|
|
* Affirmed (with a trivial test) that json_path returns its results breadth-first
|
|
* Removed the global variable json_escape_unicode and added a parameter for it
to the json_encode and json_encode_string C functions.
|
|
* Migrated test strings from json-0.0.2
* Added struct {...} orig; field to struct json_node, but it's not used yet.
It will be used to hold pointers to original text.
|
|
|
|
This repository should probably be an honest-to-goodness branch of
mainline PostgreSQL. I'm looking into that :-)
|