Re[4]: Стандарт перевода wchar_t в char
От: gear nuke  
Дата: 10.02.10 23:59
Оценка:
Здравствуйте, fk0, Вы писали:

fk0>DESCRIPTION

fk0> The wctob() function tests whether the multi-byte representation of the
fk0> wide character c, starting in the initial state, consists of a single
fk0> byte. If so, it is returned as an unsigned char.

fk0> Never use this function. It cannot help you in writing international-

fk0> ized programs. Internationalized programs must never distinguish sin-
fk0> gle-byte and multi-byte characters.

fk0> Читайте маны, они рулез (C)


rule — значит правило, стандарт. А маны привирают про возвращаемое значение. Нужна ли конверсия из wchar_t в char в "internationalized programs", или где-то ещё — с какой стати маны решают за пользователя, это так называемая свобода?

Description
The wctob function determines whether c corresponds to a member of the extended
character set whose multibyte character representation is a single byte when in the initial
shift state.

Returns
The wctob returns EOF if c does not correspond to a multibyte character with length
one in the initial shift state. Otherwise, it returns the single-byte representation of that
character as an unsigned char converted to an int.


fk0>mbstowcs таки прокатит. Но я бы потестировал везде, вроде как нигде кроме линуха

fk0>оно толком не работает вроде как.

mbstowcs определена в стандарте С, при чём тут линух
.
People who are more than casually interested in computers should have at least some idea of what the underlying hardware is like. Otherwise the programs they write will be pretty weird (c) D.Knuth
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.