Windows (MSVC, MinGW) version of setlocale don't care about LC_* environment variables. For example, flac cannot pass the test for --until and --skip options the script calls it with --skip=0:01.1001 and it expects decimal comma (--skip=0:01,1001) on my system. One solution is to write a local version of strtod that always accepts both decimal comma and decimal point. Another solution is not to call setlocale(LC_ALL, "") if some LC_* variable is set to "C". The patch is attached. -------------- next part -------------- A non-text attachment was scrubbed... Name: win_locale.patch Type: application/octet-stream Size: 1121 bytes Desc: not available Url : http://lists.xiph.org/pipermail/flac-dev/attachments/20140719/2c536160/attachment.obj
Erik de Castro Lopo
2014-Jul-19 08:23 UTC
[flac-dev] [PATCH] don't always call setlocale() on Windows
lvqcl wrote:> Windows (MSVC, MinGW) version of setlocale don't care about LC_* > environment variables. For example, flac cannot pass the test for > --until and --skip options the script calls it with --skip=0:01.1001 > and it expects decimal comma (--skip=0:01,1001) on my system. > > One solution is to write a local version of strtod that always accepts > both decimal comma and decimal point. > > Another solution is not to call setlocale(LC_ALL, "") if some > LC_* variable is set to "C". The patch is attached.Applied. Thanks. Erik -- ---------------------------------------------------------------------- Erik de Castro Lopo http://www.mega-nerd.com/
Seemingly Similar Threads
- make fullcheck fails: strtod/atof and locale
- RFC: hexadecimal constants and decimal points
- Consistency of variable storage in R and Sys.setlocale (is this a feature or bug)?
- LC_TIME not set correctly by Sys.setlocale() ?
- WISH: Sys.setlocale() to return value invisibly