update for HEAD-2003091401
[reactos.git] / lib / crtdll / mbstring / jistojms.c
1 #include <msvcrt/mbstring.h>
2
3 /*
4  * @implemented
5  */
6 unsigned short _mbcjistojms(unsigned short c)
7 {
8   int c1, c2;
9
10   c2 = (unsigned char)c;
11   c1 = c >> 8;
12   if (c1 >= 0x21 && c1 <= 0x7e && c2 >= 0x21 && c2 <= 0x7e) {
13     if (c1 & 0x01) {
14       c2 += 0x1f;
15       if (c2 >= 0x7f)
16         c2 ++;
17     } else {
18       c2 += 0x7e;
19     }
20     c1 += 0xe1;
21     c1 >>= 1;
22     if (c1 >= 0xa0)
23       c1 += 0x40;
24     return ((c1 << 8) | c2);
25   }
26   return 0;
27 }