mbtowc - combining character

O

Old Wolf

As far as I can see, mbtowc and mbstowcs assume that there is
exactly one wide character for each multi-byte sequence. How are
you meant to cope with MBS that correspond to two wide characters?

For example, if it is Unicode and the MBS represents a letter
with a combining diacritic.
 
K

klaushuotari

As far as I can see, mbtowc and mbstowcs assume that there is
exactly one wide character for each multi-byte sequence. How are
you meant to cope with MBS that correspond to two wide characters?

For example, if it is Unicode and the MBS represents a letter
with a combining diacritic.

You aren't. That's purely implementation defined.
 
C

CBFalconer

Old said:
As far as I can see, mbtowc and mbstowcs assume that there is
exactly one wide character for each multi-byte sequence. How are
you meant to cope with MBS that correspond to two wide characters?

For example, if it is Unicode and the MBS represents a letter
with a combining diacritic.

The same way you convert '\n' to a cr/lf output sequence.
 
G

Guest

Old said:
As far as I can see, mbtowc and mbstowcs assume that there is
exactly one wide character for each multi-byte sequence.

There is exactly one wide character for each multi-byte sequence.
How are
you meant to cope with MBS that correspond to two wide characters?

For example, if it is Unicode and the MBS represents a letter
with a combining diacritic.

Those are two separate multi-byte sequences. The C functions work on
the character level, not on the glyph level.
 
B

Boudewijn Dijkstra

Op Wed, 04 Apr 2007 01:18:46 +0200 schreef Old Wolf
As far as I can see, mbtowc and mbstowcs assume that there is
exactly one wide character for each multi-byte sequence. How are
you meant to cope with MBS that correspond to two wide characters?

For example, if it is Unicode and the MBS represents a letter
with a combining diacritic.

Perform canonical decomposition before converting.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top