mirror of
https://github.com/reactos/reactos.git
synced 2025-07-01 06:41:22 +00:00
Create a branch for header work.
svn path=/branches/header-work/; revision=45691
This commit is contained in:
parent
14fe274b1c
commit
9ea495ba33
19538 changed files with 0 additions and 1063950 deletions
28
lib/sdk/crt/mbstring/jmstojis.c
Normal file
28
lib/sdk/crt/mbstring/jmstojis.c
Normal file
|
@ -0,0 +1,28 @@
|
|||
#include <mbstring.h>
|
||||
|
||||
/*
|
||||
* @implemented
|
||||
*/
|
||||
unsigned int _mbcjmstojis(unsigned int c)
|
||||
{
|
||||
int c1, c2;
|
||||
|
||||
c2 = (unsigned char)c;
|
||||
c1 = c >> 8;
|
||||
if (c1 < 0xf0 && _ismbblead(c1) && _ismbbtrail(c2)) {
|
||||
if (c1 >= 0xe0)
|
||||
c1 -= 0x40;
|
||||
c1 -= 0x70;
|
||||
c1 <<= 1;
|
||||
if (c2 < 0x9f) {
|
||||
c1 --;
|
||||
c2 -= 0x1f;
|
||||
if (c2 >= (0x80-0x1f))
|
||||
c2 --;
|
||||
} else {
|
||||
c2 -= 0x7e;
|
||||
}
|
||||
return ((c1 << 8) | c2);
|
||||
}
|
||||
return 0;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue