Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize

_mbcjistojms, _mbcjistojms_l, _mbcjmstojis, _mbcjmstojis_l

Converts between Japan Industry Standard (JIS) and Japan Microsoft (JMS) characters.

Important note Important

This API cannot be used in applications that execute in the Windows Runtime. For more information, see CRT functions not supported with /ZW.

unsigned int _mbcjistojms(
   unsigned int c 
unsigned int _mbcjistojms_l(
   unsigned int c,
   _locale_t locale
unsigned int _mbcjmstojis(
   unsigned int c 
unsigned int _mbcjmstojis_l(
   unsigned int c,
   _locale_t locale


Character to convert.


Locale to use.

On Japanese locale, these functions return a converted character or return 0 if no conversion is possible. On a non-Japanese locale, these functions return the character passed in.

The _mbcjistojms function converts a Japan Industry Standard (JIS) character to a Microsoft Kanji (Shift JIS) character. The character is converted only if the lead and trail bytes are in the range 0x21 – 0x7E. If the lead or trial byte is outside this range, errno is set to EILSEQ. For more information about this and other error codes, see errno, _doserrno, _sys_errlist, and _sys_nerr.

The _mbcjmstojisfunction converts a Shift JIS character to a JIS character. The character is converted only if the lead byte is in the range 0x81 – 0x9F or 0xE0 – 0xFC and the trail byte is in the range 0x40 – 0x7E or 0x80 – 0xFC. Note that some code points in that range do not have a character assigned and so cannot be converted.

The value c should be a 16-bit value whose upper 8 bits represent the lead byte of the character to convert and whose lower 8 bits represent the trail byte.

The output value is affected by the setting of the LC_CTYPE category setting of the locale; see setlocale for more information. The versions of these functions without the _l suffix use the current locale for this locale-dependent behavior; the versions with the _l suffix are identical except that they use the locale parameter passed in instead. For more information, see Locale.

In earlier versions, _mbcjistojms and _mbcjmstojis were calledjistojms and jmstojis, respectively. _mbcjistojms,_mbcjistojms_l,_mbcjmstojis and _mbcjmstojis_l should be used instead.


Required header









For more compatibility information, see Compatibility in the Introduction.

Not applicable. To call the standard C function, use PInvoke. For more information, see Platform Invoke Examples.

© 2015 Microsoft