reactos/lib/sdk/crt/mbstring/jistojms.c
Art Yerkes c501d8112c Create a branch for network fixes.
svn path=/branches/aicom-network-fixes/; revision=34994
2008-08-01 11:32:26 +00:00

29 lines
457 B
C

#include <precomp.h>
#include <mbstring.h>
/*
* @implemented
*/
unsigned int _mbcjistojms(unsigned int c)
{
int c1, c2;
c2 = (unsigned char)c;
c1 = c >> 8;
if (c1 >= 0x21 && c1 <= 0x7e && c2 >= 0x21 && c2 <= 0x7e) {
if (c1 & 0x01) {
c2 += 0x1f;
if (c2 >= 0x7f)
c2 ++;
} else {
c2 += 0x7e;
}
c1 += 0xe1;
c1 >>= 1;
if (c1 >= 0xa0)
c1 += 0x40;
return ((c1 << 8) | c2);
}
return 0;
}