On Monday 21 February 2005 16:18, Hrvoje Niksic wrote:

> Also, gettext doesn't change behavior of low-level
> routines in a fundamental way -- it's just a way of getting different
> strings.  On the other hand, wide chars do introduce pretty invasive
> changes to the way things work.  The most basic things like printf and
> strlen suddenly no longer work.

Except this is a wrong assumption.

gettext gives you a char pointer, but what's inside that buffer?  It depends 
on the *user's* locale, and therefore could be anything, including widechars.  
It could even have NUL bytes in the middle, in case they are OK in that 
locale.  The fact is, basic things like printf and strlen are *already* 
broken when you use gettext.

See Mauro's last reply for potential interpolation problems, but more 
interestingly try to think to what happens if a string has a legal NUL byte 
in the middle.  It would be printed truncated, effectively hiding what's 
after the NUL.

/Simone

-- 
Adde parvum parvo magnus acervus erit -- Ovidio

Reply via email to