ReactOS  0.4.14-dev-115-g4576127
jistojms.c File Reference
#include <precomp.h>
#include <mbstring.h>
#include <locale.h>
Include dependency graph for jistojms.c:

Go to the source code of this file.

Functions

unsigned int _mbcjistojms (unsigned int c)
 

Function Documentation

◆ _mbcjistojms()

unsigned int _mbcjistojms ( unsigned int  c)

Definition at line 32 of file jistojms.c.

33 {
34  /* Conversion takes place only when codepage is 932.
35  In all other cases, c is returned unchanged */
36  if(get_mbcinfo()->mbcodepage == 932)
37  {
38  if(HIBYTE(c) >= 0x21 && HIBYTE(c) <= 0x7e &&
39  LOBYTE(c) >= 0x21 && LOBYTE(c) <= 0x7e)
40  {
41  if(HIBYTE(c) % 2)
42  c += 0x1f;
43  else
44  c += 0x7d;
45 
46  if(LOBYTE(c) >= 0x7F)
47  c += 0x1;
48 
49  c = (((HIBYTE(c) - 0x21)/2 + 0x81) << 8) | LOBYTE(c);
50 
51  if(HIBYTE(c) > 0x9f)
52  c += 0x4000;
53  }
54  else
55  return 0; /* Codepage is 932, but c can't be converted */
56  }
57 
58  return c;
59 }
#define LOBYTE(W)
Definition: jmemdos.c:487
#define HIBYTE(W)
Definition: jmemdos.c:486
const GLubyte * c
Definition: glext.h:8905
MSVCRT_pthreadmbcinfo get_mbcinfo(void)
Definition: locale.c:364
#define c
Definition: ke_i.h:80