1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 // MARKER(update_precomp.py): autogen include statement, do not remove 25 #include "precompiled_i18npool.hxx" 26 27 // prevent internal compiler error with MSVC6SP3 28 #include <utility> 29 30 #define TRANSLITERATION_katakanaToHiragana 31 #include <transliteration_OneToOne.hxx> 32 33 namespace com { namespace sun { namespace star { namespace i18n { 34 35 // see http://charts.unicode.org/Web/U3040.html Hiragana (U+3040..U+309F) 36 // see http://charts.unicode.org/Web/U30A0.html Katakana (U+30A0..U+30FF) toHiragana(const sal_Unicode c)37static sal_Unicode toHiragana (const sal_Unicode c) 38 { 39 if ( (0x30a1 <= c && c <= 0x30f6) || (0x30fd <= c && c <= 0x30ff) ) { // 30A0 - 30FF KATAKANA LETTER 40 // shift code point by 0x0060 41 return c - (0x30a0 - 0x3040); 42 } 43 return c; 44 } 45 katakanaToHiragana()46katakanaToHiragana::katakanaToHiragana() 47 { 48 func = toHiragana; 49 table = 0; 50 transliterationName = "katakanaToHiragana"; 51 implementationName = "com.sun.star.i18n.Transliteration.KATAKANA_HIRAGANA"; 52 } 53 54 } } } } 55