This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: C++ translation improvement
Jason Merrill <jason at redhat dot com> writes:
> On Sun, 06 Apr 2003 18:52:51 -0700, Zack Weinberg <zack at codesourcery dot com> wrote:
>> The last time I posted it, someone pointed out that the indentation
>> logic is broken for non-unibyte character sets, but I don't see any
>> way to do it correctly with the existing API. It can be fixed in a
>> follow-up patch if someone figures out how.
>
> Would %n be useful?
I don't think so - the spec for %n says 'stores the number of
characters written', when what we want is the width in columns
of the string.
wcswidth(mbstowcs(str)) is the number really wanted -- except that we
can't count on those functions being present, and even if we could, we
can't count on str being in the character set mbstowcs expects.
zw