Character set conversions

"Jérôme M. Berger" jeberger at free.fr
Mon May 30 14:40:43 PDT 2011


Daniel Gibson wrote:
> In plain C (at least on Linux) you have fun locale-dependent in/output
> as well: printf and scanf are locale dependent, so if you use sprintf
> to generate a string you'll write into a file (or fprintf directly) with
> one locale, reading it with scanf functions with another locale will fail.
> Pretty fucking stupid IMHO.
> This was/is(?) a bug in GtkRadiant, a level editor for Quake like games,
> which uses printf or something to write the map files. The map compiler
> will reject them if decimals use a , instead of a . and stuff like that.
> (The workaround is to always use the standard LOCALE, i.e. "LC_ALL=C
> gtkradiant" to start it).
> 
	Actually, that is the same issue: Excel outputs numbers to CSV in a
locale dependent way (probably using printf), which means that in
some locales the decimal point is a coma, which prevents using it as
a field separator. Braindead of course, and a real pain when you
want to interface with other software.

		Jerome
-- 
mailto:jeberger at free.fr
http://jeberger.free.fr
Jabber: jeberger at jabber.fr

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: OpenPGP digital signature
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20110530/282ab325/attachment.pgp>


More information about the Digitalmars-d mailing list