mirror of
https://github.com/reactos/reactos.git
synced 2025-08-07 03:03:13 +00:00
Create a branch for Aleksandar Andrejevic for his work on NTVDM. See http://jira.reactos.org/browse/CORE-7250 for more details.
svn path=/branches/ntvdm/; revision=59241
This commit is contained in:
parent
3e3200acef
commit
4f0b8d3db0
20620 changed files with 0 additions and 1232833 deletions
34
lib/sdk/crt/mbstring/jmstojis.c
Normal file
34
lib/sdk/crt/mbstring/jmstojis.c
Normal file
|
@ -0,0 +1,34 @@
|
|||
#include <precomp.h>
|
||||
#include <mbstring.h>
|
||||
#include <locale.h>
|
||||
|
||||
/*
|
||||
* @implemented
|
||||
*/
|
||||
unsigned int __cdecl _mbcjmstojis(unsigned int c)
|
||||
{
|
||||
/* Conversion takes place only when codepage is 932.
|
||||
In all other cases, c is returned unchanged */
|
||||
if(get_mbcinfo()->mbcodepage == 932)
|
||||
{
|
||||
if(_ismbclegal(c) && HIBYTE(c) < 0xf0)
|
||||
{
|
||||
if(HIBYTE(c) >= 0xe0)
|
||||
c -= 0x4000;
|
||||
|
||||
c = (((HIBYTE(c) - 0x81)*2 + 0x21) << 8) | LOBYTE(c);
|
||||
|
||||
if(LOBYTE(c) > 0x7f)
|
||||
c -= 0x1;
|
||||
|
||||
if(LOBYTE(c) > 0x9d)
|
||||
c += 0x83;
|
||||
else
|
||||
c -= 0x1f;
|
||||
}
|
||||
else
|
||||
return 0; /* Codepage is 932, but c can't be converted */
|
||||
}
|
||||
|
||||
return c;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue