Re: sprintf and utf8



Joel Becker <jlbec evilplan org> writes:

> On Sat, Mar 30, 2002 at 01:14:02PM -0500, Owen Taylor wrote:
> > 
> >  * We are in fact assuming ASCII compatible locales. This 
> >    is basically safe because pretty much everybody else
> >    does too. So " " is " ", in ASCII, UTF-8, and the current
> >    locale.
> > 
> >  * We also assume the results of %d and %g are ASCII.
> >    This is not quite so safe as the previous assumption,
> >    but I'm not aware of any locales that violate it.
> >    ("Arabic-Indic" numerals are used for in some contexts
> >    for Arabic, Farsi, etc, but the more familiar Arabic
> >    numerals are also understood, and I believe, generally
> >    used in technical contexts.)
> 
> 	So, to be clear, encodings like Big5, euc*, and KOI8-R all are
> ASCII compatible and sprintf %d to ASCII? 

They are definitely all ascii compatible, and, in my
experience, all sprintf %d to ASCII.

> I'm not that familiar with
> them, but aren't some of them multibyte?

Multibyte generally means something like:

 One bye of ascii

Or:

 Two bytes of > 0x80 characters

(With some more complicated variants.)

Regards,
                                        Owen






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]