ReactOS  0.4.13-dev-66-gc714b7f
jmstojis.c File Reference
#include <precomp.h>
#include <mbstring.h>
#include <locale.h>
Include dependency graph for jmstojis.c:

Go to the source code of this file.

Functions

unsigned int __cdecl _mbcjmstojis (unsigned int c)
 

Function Documentation

◆ _mbcjmstojis()

unsigned int __cdecl _mbcjmstojis ( unsigned int  c)

Definition at line 8 of file jmstojis.c.

9 {
10  /* Conversion takes place only when codepage is 932.
11  In all other cases, c is returned unchanged */
12  if(get_mbcinfo()->mbcodepage == 932)
13  {
14  if(_ismbclegal(c) && HIBYTE(c) < 0xf0)
15  {
16  if(HIBYTE(c) >= 0xe0)
17  c -= 0x4000;
18 
19  c = (((HIBYTE(c) - 0x81)*2 + 0x21) << 8) | LOBYTE(c);
20 
21  if(LOBYTE(c) > 0x7f)
22  c -= 0x1;
23 
24  if(LOBYTE(c) > 0x9d)
25  c += 0x83;
26  else
27  c -= 0x1f;
28  }
29  else
30  return 0; /* Codepage is 932, but c can't be converted */
31  }
32 
33  return c;
34 }
#define LOBYTE(W)
Definition: jmemdos.c:487
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG x1
Definition: winddi.h:3706
#define HIBYTE(W)
Definition: jmemdos.c:486
_Check_return_ _CRTIMP int __cdecl _ismbclegal(_In_ unsigned int _Ch)
const GLubyte * c
Definition: glext.h:8905
MSVCRT_pthreadmbcinfo get_mbcinfo(void)
Definition: locale.c:364
#define c
Definition: ke_i.h:80