git://git.jankratochvil.net
/
reactos.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
:pserver:cvsanon@mok.lvcm.com:/CVS/ReactOS reactos
[reactos.git]
/
lib
/
crtdll
/
mbstring
/
jistojms.c
1
#include <crtdll/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
}