diff options
| author | Mark Pulford <mark@kyne.com.au> | 2011-10-07 23:55:49 +1030 |
|---|---|---|
| committer | Mark Pulford <mark@kyne.com.au> | 2011-10-07 23:55:49 +1030 |
| commit | 049691cb11115fbdb750021556cad3507fad4e69 (patch) | |
| tree | 3ef83227a086c2dbd70633a55a8425335a8e92fb /README | |
| parent | 48c5cf183fa7cab608168fdec2406a1ca3cb2c11 (diff) | |
| download | lua-cjson-049691cb11115fbdb750021556cad3507fad4e69.tar.gz lua-cjson-049691cb11115fbdb750021556cad3507fad4e69.tar.bz2 lua-cjson-049691cb11115fbdb750021556cad3507fad4e69.zip | |
Add USE_POSIX_SETLOCALE option
Add USE_POSIX_SETLOCALE option for platforms missing uselocale().
Document locale options in README, Makefile & rockspec.
Also:
- Rename USE_POSIX_LOCALE define to USE_POSIX_USELOCALE.
- Use uselocale() by default through Makefile (Linux, OSX).
- Use setlocale() by default through rockspec (other platforms).
Diffstat (limited to 'README')
| -rw-r--r-- | README | 12 |
1 files changed, 12 insertions, 0 deletions
| @@ -309,6 +309,18 @@ Lua CJSON will generate an error if asked to serialise Lua functions, | |||
| 309 | userdata, lightuserdata or threads. | 309 | userdata, lightuserdata or threads. |
| 310 | 310 | ||
| 311 | 311 | ||
| 312 | Locale handling | ||
| 313 | --------------- | ||
| 314 | |||
| 315 | Lua CJSON uses strtod() and snprintf() to perform numeric conversion | ||
| 316 | as they are usually well supported, fast and bug free. | ||
| 317 | |||
| 318 | To ensure JSON encoding/decoding works correctly for locales using | ||
| 319 | comma decimal separators, Lua CJSON must be compiled with either | ||
| 320 | USE_POSIX_USELOCALE or USE_POSIX_SETLOCALE. See the Makefile or the | ||
| 321 | rockspec for details. | ||
| 322 | |||
| 323 | |||
| 312 | References | 324 | References |
| 313 | ========== | 325 | ========== |
| 314 | 326 | ||
