reactos/lib/sdk/crt/mbstring/jmstojis.c
Amine Khaldi c424146e2c Create a branch for cmake bringup.
svn path=/branches/cmake-bringup/; revision=48236
2010-07-24 18:52:44 +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;
}