reactos/lib/sdk/crt/mbstring/jmstojis.c
Timo Kreuzer 5eb25b5c24 Create a branch for audio work
svn path=/branches/audio-bringup/; revision=49478
2010-11-05 11:04:48 +00:00

29 lines
449 B
C

#include <mbstring.h>
/*
* @implemented
*/
unsigned int _mbcjmstojis(unsigned int c)
{
int c1, c2;
c2 = (unsigned char)c;
c1 = c >> 8;
if (c1 < 0xf0 && _ismbblead(c1) && _ismbbtrail(c2)) {
if (c1 >= 0xe0)
c1 -= 0x40;
c1 -= 0x70;
c1 <<= 1;
if (c2 < 0x9f) {
c1 --;
c2 -= 0x1f;
if (c2 >= (0x80-0x1f))
c2 --;
} else {
c2 -= 0x7e;
}
return ((c1 << 8) | c2);
}
return 0;
}