Re: what encoding does sprintf() expect?
Re: what encoding does sprintf() expect?
- Subject: Re: what encoding does sprintf() expect?
- From: Ken Turkowski <email@hidden>
- Date: Mon, 12 Dec 2005 00:14:50 -0800
I'm pretty sure that sprintf will work with any character encoding
that is an extension of ASCII. This includes MacRoman, Latin-1 aka
ISO-8859-1, Windows aka ANSI, and UTF-8. Beware of trying to limit
the field size, when the field contains multi-byte UTF-8 characters,
e.g.
sprintf(buf, "%.4s" uniStr);
This may not print out any characters, because there are some 6-byte
UTF-8 characters, and sprintf assumes that 1 byte = 1 character. If
you don't try to limit the precision of a string, sprintf should work
just fine.
-Ken Turkowski
On Dec 9, 2005, at 11:30 AM, "Sean McBride" <email@hidden>
wrote:
Also, what encoding does sprintf() expect?
--
Ken Turkowski email@hidden
Reality Pixels
http://www.realitypixels.com
Computer Graphics 2D 3D Immersive Imagery
Photo-mosaicing Panoramas Computer Vision
Applied Mathematics Numerical Analysis Optimization
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden