mirror of
https://github.com/reactos/reactos.git
synced 2025-07-23 15:53:39 +00:00
29 lines
457 B
C
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;
|
|
}
|