From 049691cb11115fbdb750021556cad3507fad4e69 Mon Sep 17 00:00:00 2001 From: Mark Pulford Date: Fri, 7 Oct 2011 23:55:49 +1030 Subject: 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). --- README | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'README') diff --git a/README b/README index e8c3abe..f863d73 100644 --- a/README +++ b/README @@ -309,6 +309,18 @@ Lua CJSON will generate an error if asked to serialise Lua functions, userdata, lightuserdata or threads. +Locale handling +--------------- + +Lua CJSON uses strtod() and snprintf() to perform numeric conversion +as they are usually well supported, fast and bug free. + +To ensure JSON encoding/decoding works correctly for locales using +comma decimal separators, Lua CJSON must be compiled with either +USE_POSIX_USELOCALE or USE_POSIX_SETLOCALE. See the Makefile or the +rockspec for details. + + References ========== -- cgit v1.2.3-55-g6feb