Added binary and unicode file i/o support to msvcrt.
[reactos.git] / reactos / lib / crtdll / mbstring / jistojms.c
1 #include <msvcrt/mbstring.h>
2
3 unsigned short _mbcjistojms(unsigned short c)
4 {
5 int c1, c2;
6
7 c2 = (unsigned char)c;
8 c1 = c >> 8;
9 if (c1 >= 0x21 && c1 <= 0x7e && c2 >= 0x21 && c2 <= 0x7e) {
10 if (c1 & 0x01) {
11 c2 += 0x1f;
12 if (c2 >= 0x7f)
13 c2 ++;
14 } else {
15 c2 += 0x7e;
16 }
17 c1 += 0xe1;
18 c1 >>= 1;
19 if (c1 >= 0xa0)
20 c1 += 0x40;
21 return ((c1 << 8) | c2);
22 }
23 return 0;
24 }