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_hiraganaToKatakana
31 #include <transliteration_OneToOne.hxx>
32 
33 using namespace com::sun::star::uno;
34 using namespace com::sun::star::lang;
35 using namespace rtl;
36 
37 namespace com { namespace sun { namespace star { namespace i18n {
38 
39 // see http://charts.unicode.org/Web/U3040.html Hiragana (U+3040..U+309F)
40 // see http://charts.unicode.org/Web/U30A0.html Katakana (U+30A0..U+30FF)
toKatakana(const sal_Unicode c)41 static sal_Unicode toKatakana (const sal_Unicode c) {
42         if ( (0x3041 <= c && c <= 0x3096) || (0x309d <= c && c <= 0x309f) ) { // 3040 - 309F HIRAGANA LETTER
43             // shift code point by 0x0060
44             return c + (0x30a0 - 0x3040);
45         }
46         return c;
47 }
48 
hiraganaToKatakana()49 hiraganaToKatakana::hiraganaToKatakana()
50 {
51         func = toKatakana;
52         table = 0;
53         transliterationName = "hiraganaToKatakana";
54         implementationName = "com.sun.star.i18n.Transliteration.HIRAGANA_KATAKANA";
55 }
56 
57 } } } }
58