2016-09-10 11:40:54 +00:00
|
|
|
#include <precomp.h>
|
2007-03-14 20:24:57 +00:00
|
|
|
#include <mbctype.h>
|
|
|
|
|
2016-09-10 11:40:54 +00:00
|
|
|
/*********************************************************************
|
|
|
|
* _ismbchira(MSVCRT.@)
|
2007-03-14 20:24:57 +00:00
|
|
|
*/
|
2016-09-10 11:40:54 +00:00
|
|
|
int CDECL _ismbchira(unsigned int c)
|
2007-03-14 20:24:57 +00:00
|
|
|
{
|
2016-09-10 11:40:54 +00:00
|
|
|
if(get_mbcinfo()->mbcodepage == 932)
|
|
|
|
{
|
|
|
|
/* Japanese/Hiragana, CP 932 */
|
|
|
|
return (c >= 0x829f && c <= 0x82f1);
|
|
|
|
}
|
|
|
|
return 0;
|
2007-03-14 20:24:57 +00:00
|
|
|
}
|
|
|
|
|
2016-09-10 11:40:54 +00:00
|
|
|
/*********************************************************************
|
|
|
|
* _ismbckata(MSVCRT.@)
|
2007-03-14 20:24:57 +00:00
|
|
|
*/
|
2016-09-10 11:40:54 +00:00
|
|
|
int CDECL _ismbckata(unsigned int c)
|
2007-03-14 20:24:57 +00:00
|
|
|
{
|
2016-09-10 11:40:54 +00:00
|
|
|
if(get_mbcinfo()->mbcodepage == 932)
|
|
|
|
{
|
|
|
|
/* Japanese/Katakana, CP 932 */
|
|
|
|
return (c >= 0x8340 && c <= 0x8396 && c != 0x837f);
|
|
|
|
}
|
|
|
|
return 0;
|
2007-03-14 20:24:57 +00:00
|
|
|
}
|
|
|
|
|
2016-09-10 11:40:54 +00:00
|
|
|
/*********************************************************************
|
|
|
|
* _mbctohira (MSVCRT.@)
|
|
|
|
*
|
|
|
|
* Converts a sjis katakana character to hiragana.
|
2007-03-14 20:24:57 +00:00
|
|
|
*/
|
2016-09-10 11:40:54 +00:00
|
|
|
unsigned int CDECL _mbctohira(unsigned int c)
|
2007-03-14 20:24:57 +00:00
|
|
|
{
|
2016-09-10 11:40:54 +00:00
|
|
|
if(_ismbckata(c) && c <= 0x8393)
|
|
|
|
return (c - 0x8340 - (c >= 0x837f ? 1 : 0)) + 0x829f;
|
|
|
|
return c;
|
2007-03-14 20:24:57 +00:00
|
|
|
}
|
|
|
|
|
2016-09-10 11:40:54 +00:00
|
|
|
/*********************************************************************
|
|
|
|
* _mbctokata (MSVCRT.@)
|
|
|
|
*
|
|
|
|
* Converts a sjis hiragana character to katakana.
|
2007-03-14 20:24:57 +00:00
|
|
|
*/
|
2016-09-10 11:40:54 +00:00
|
|
|
unsigned int CDECL _mbctokata(unsigned int c)
|
2007-03-14 20:24:57 +00:00
|
|
|
{
|
2016-09-10 11:40:54 +00:00
|
|
|
if(_ismbchira(c))
|
|
|
|
return (c - 0x829f) + 0x8340 + (c >= 0x82de ? 1 : 0);
|
|
|
|
return c;
|
2007-03-14 20:24:57 +00:00
|
|
|
}
|
|
|
|
|
2008-06-06 17:49:24 +00:00
|
|
|
|