-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Alexey Pechnikov wrote:
> The locale of CSV file may be defined in virtualtable arguments like to
> create virtual table test using VirtualText 
> ('/srv/projects/work/billing/export/ats.csv','utf8','','.',',',',');
> 
> But _default_ may be system locale. How to do filesystem access in a 
> virtualtable without locale 
> information? 

The best I can see is to call setlocale yourself, saving the prior locale
that it returns, then using localeconv/nl_langinfo to get the info you need
and then calling setlocale again with the original locale returned by your
setlocale call.

This will be fine for single threaded programs but for multi-threaded
programs will have temporarily changed the locale for a short while.  To be
100% correct in that case I'd fork and then let the child process gather
locale information to return to the parent over a pipe.  (A lot of work for
something so simple!)

On Linux you can also parse files in /usr/share/i18n/locales.  Heck you
could probably just compile the info into your code.

Roger
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkslM/kACgkQmOOfHg372QT8ZgCfTLb/1zCLQZORm6vYcrAklrWm
/wIAn1FmC3mmKaYMBsCmL6Oq+GSbRw2d
=hUCe
-----END PGP SIGNATURE-----
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to