Reactos
at master 52 lines 1.2 kB view raw
1/*** 2*mbtokata.c - Converts character to katakana. 3* 4* Copyright (c) Microsoft Corporation. All rights reserved. 5* 6*Purpose: 7* Converts a character from hiragana to katakana. 8* 9*******************************************************************************/ 10#ifndef _MBCS 11 #error This file should only be compiled with _MBCS defined 12#endif 13 14#include <corecrt_internal_mbstring.h> 15#include <locale.h> 16 17 18/*** 19*unsigned short _mbctokata(c) - Converts character to katakana. 20* 21*Purpose: 22* If the character c is hiragana, convert to katakana. 23* 24*Entry: 25* unsigned int c - Character to convert. 26* 27*Exit: 28* Returns converted character. 29* 30*Exceptions: 31* 32*******************************************************************************/ 33 34extern "C" unsigned int __cdecl _mbctokata_l( 35 unsigned int c, 36 _locale_t plocinfo 37 ) 38{ 39 if (_ismbchira_l(c, plocinfo)) { 40 c += 0xa1; 41 if (c >= 0x837f) 42 c++; 43 } 44 return(c); 45} 46 47extern "C" unsigned int (__cdecl _mbctokata)( 48 unsigned int c 49 ) 50{ 51 return _mbctokata_l(c, nullptr); 52}