1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir 
28*cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
29*cdf0e10cSrcweir #include "precompiled_i18npool.hxx"
30*cdf0e10cSrcweir 
31*cdf0e10cSrcweir // prevent internal compiler error with MSVC6SP3
32*cdf0e10cSrcweir #include <utility>
33*cdf0e10cSrcweir 
34*cdf0e10cSrcweir #define TRANSLITERATION_ProlongedSoundMark_ja_JP
35*cdf0e10cSrcweir #include <transliteration_Ignore.hxx>
36*cdf0e10cSrcweir 
37*cdf0e10cSrcweir using namespace com::sun::star::uno;
38*cdf0e10cSrcweir using namespace com::sun::star::lang;
39*cdf0e10cSrcweir using namespace rtl;
40*cdf0e10cSrcweir 
41*cdf0e10cSrcweir namespace com { namespace sun { namespace star { namespace i18n {
42*cdf0e10cSrcweir 
43*cdf0e10cSrcweir static sal_Unicode table_normalwidth[] = {
44*cdf0e10cSrcweir     //  0x0000,   // 0x3040
45*cdf0e10cSrcweir     0x3041,       // 0x3041 HIRAGANA LETTER SMALL A
46*cdf0e10cSrcweir     0x3042,       // 0x3042 HIRAGANA LETTER A
47*cdf0e10cSrcweir     0x3043,       // 0x3043 HIRAGANA LETTER SMALL I
48*cdf0e10cSrcweir     0x3044,       // 0x3044 HIRAGANA LETTER I
49*cdf0e10cSrcweir     0x3045,       // 0x3045 HIRAGANA LETTER SMALL U
50*cdf0e10cSrcweir     0x3046,       // 0x3046 HIRAGANA LETTER U
51*cdf0e10cSrcweir     0x3047,       // 0x3047 HIRAGANA LETTER SMALL E
52*cdf0e10cSrcweir     0x3048,       // 0x3048 HIRAGANA LETTER E
53*cdf0e10cSrcweir     0x3049,       // 0x3049 HIRAGANA LETTER SMALL O
54*cdf0e10cSrcweir     0x304a,       // 0x304a HIRAGANA LETTER O
55*cdf0e10cSrcweir     0x3042,       // 0x304b HIRAGANA LETTER KA
56*cdf0e10cSrcweir     0x3042,       // 0x304c HIRAGANA LETTER GA
57*cdf0e10cSrcweir     0x3044,       // 0x304d HIRAGANA LETTER KI
58*cdf0e10cSrcweir     0x3044,       // 0x304e HIRAGANA LETTER GI
59*cdf0e10cSrcweir     0x3046,       // 0x304f HIRAGANA LETTER KU
60*cdf0e10cSrcweir     0x3046,       // 0x3050 HIRAGANA LETTER GU
61*cdf0e10cSrcweir     0x3048,       // 0x3051 HIRAGANA LETTER KE
62*cdf0e10cSrcweir     0x3048,       // 0x3052 HIRAGANA LETTER GE
63*cdf0e10cSrcweir     0x304a,       // 0x3053 HIRAGANA LETTER KO
64*cdf0e10cSrcweir     0x304a,       // 0x3054 HIRAGANA LETTER GO
65*cdf0e10cSrcweir     0x3042,       // 0x3055 HIRAGANA LETTER SA
66*cdf0e10cSrcweir     0x3042,       // 0x3056 HIRAGANA LETTER ZA
67*cdf0e10cSrcweir     0x3044,       // 0x3057 HIRAGANA LETTER SI
68*cdf0e10cSrcweir     0x3044,       // 0x3058 HIRAGANA LETTER ZI
69*cdf0e10cSrcweir     0x3046,       // 0x3059 HIRAGANA LETTER SU
70*cdf0e10cSrcweir     0x3046,       // 0x305a HIRAGANA LETTER ZU
71*cdf0e10cSrcweir     0x3048,       // 0x305b HIRAGANA LETTER SE
72*cdf0e10cSrcweir     0x3048,       // 0x305c HIRAGANA LETTER ZE
73*cdf0e10cSrcweir     0x304a,       // 0x305d HIRAGANA LETTER SO
74*cdf0e10cSrcweir     0x304a,       // 0x305e HIRAGANA LETTER ZO
75*cdf0e10cSrcweir     0x3042,       // 0x305f HIRAGANA LETTER TA
76*cdf0e10cSrcweir     0x3042,       // 0x3060 HIRAGANA LETTER DA
77*cdf0e10cSrcweir     0x3044,       // 0x3061 HIRAGANA LETTER TI
78*cdf0e10cSrcweir     0x3044,       // 0x3062 HIRAGANA LETTER DI
79*cdf0e10cSrcweir     0x3045,       // 0x3063 HIRAGANA LETTER SMALL TU
80*cdf0e10cSrcweir     0x3046,       // 0x3064 HIRAGANA LETTER TU
81*cdf0e10cSrcweir     0x3046,       // 0x3065 HIRAGANA LETTER DU
82*cdf0e10cSrcweir     0x3048,       // 0x3066 HIRAGANA LETTER TE
83*cdf0e10cSrcweir     0x3048,       // 0x3067 HIRAGANA LETTER DE
84*cdf0e10cSrcweir     0x304a,       // 0x3068 HIRAGANA LETTER TO
85*cdf0e10cSrcweir     0x304a,       // 0x3069 HIRAGANA LETTER DO
86*cdf0e10cSrcweir     0x3042,       // 0x306a HIRAGANA LETTER NA
87*cdf0e10cSrcweir     0x3044,       // 0x306b HIRAGANA LETTER NI
88*cdf0e10cSrcweir     0x3046,       // 0x306c HIRAGANA LETTER NU
89*cdf0e10cSrcweir     0x3048,       // 0x306d HIRAGANA LETTER NE
90*cdf0e10cSrcweir     0x304a,       // 0x306e HIRAGANA LETTER NO
91*cdf0e10cSrcweir     0x3042,       // 0x306f HIRAGANA LETTER HA
92*cdf0e10cSrcweir     0x3042,       // 0x3070 HIRAGANA LETTER BA
93*cdf0e10cSrcweir     0x3042,       // 0x3071 HIRAGANA LETTER PA
94*cdf0e10cSrcweir     0x3044,       // 0x3072 HIRAGANA LETTER HI
95*cdf0e10cSrcweir     0x3044,       // 0x3073 HIRAGANA LETTER BI
96*cdf0e10cSrcweir     0x3044,       // 0x3074 HIRAGANA LETTER PI
97*cdf0e10cSrcweir     0x3046,       // 0x3075 HIRAGANA LETTER HU
98*cdf0e10cSrcweir     0x3046,       // 0x3076 HIRAGANA LETTER BU
99*cdf0e10cSrcweir     0x3046,       // 0x3077 HIRAGANA LETTER PU
100*cdf0e10cSrcweir     0x3048,       // 0x3078 HIRAGANA LETTER HE
101*cdf0e10cSrcweir     0x3048,       // 0x3079 HIRAGANA LETTER BE
102*cdf0e10cSrcweir     0x3048,       // 0x307a HIRAGANA LETTER PE
103*cdf0e10cSrcweir     0x304a,       // 0x307b HIRAGANA LETTER HO
104*cdf0e10cSrcweir     0x304a,       // 0x307c HIRAGANA LETTER BO
105*cdf0e10cSrcweir     0x304a,       // 0x307d HIRAGANA LETTER PO
106*cdf0e10cSrcweir     0x3042,       // 0x307e HIRAGANA LETTER MA
107*cdf0e10cSrcweir     0x3044,       // 0x307f HIRAGANA LETTER MI
108*cdf0e10cSrcweir     0x3046,       // 0x3080 HIRAGANA LETTER MU
109*cdf0e10cSrcweir     0x3048,       // 0x3081 HIRAGANA LETTER ME
110*cdf0e10cSrcweir     0x304a,       // 0x3082 HIRAGANA LETTER MO
111*cdf0e10cSrcweir     0x3041,       // 0x3083 HIRAGANA LETTER SMALL YA
112*cdf0e10cSrcweir     0x3042,       // 0x3084 HIRAGANA LETTER YA
113*cdf0e10cSrcweir     0x3045,       // 0x3085 HIRAGANA LETTER SMALL YU
114*cdf0e10cSrcweir     0x3046,       // 0x3086 HIRAGANA LETTER YU
115*cdf0e10cSrcweir     0x3049,       // 0x3087 HIRAGANA LETTER SMALL YO
116*cdf0e10cSrcweir     0x304a,       // 0x3088 HIRAGANA LETTER YO
117*cdf0e10cSrcweir     0x3042,       // 0x3089 HIRAGANA LETTER RA
118*cdf0e10cSrcweir     0x3044,       // 0x308a HIRAGANA LETTER RI
119*cdf0e10cSrcweir     0x3046,       // 0x308b HIRAGANA LETTER RU
120*cdf0e10cSrcweir     0x3048,       // 0x308c HIRAGANA LETTER RE
121*cdf0e10cSrcweir     0x304a,       // 0x308d HIRAGANA LETTER RO
122*cdf0e10cSrcweir     0x3041,       // 0x308e HIRAGANA LETTER SMALL WA
123*cdf0e10cSrcweir     0x3042,       // 0x308f HIRAGANA LETTER WA
124*cdf0e10cSrcweir     0x3044,       // 0x3090 HIRAGANA LETTER WI
125*cdf0e10cSrcweir     0x3048,       // 0x3091 HIRAGANA LETTER WE
126*cdf0e10cSrcweir     0x304a,       // 0x3092 HIRAGANA LETTER WO
127*cdf0e10cSrcweir     0x0000,       // 0x3093 HIRAGANA LETTER N
128*cdf0e10cSrcweir     0x3046,       // 0x3094 HIRAGANA LETTER VU
129*cdf0e10cSrcweir     0x0000,       // 0x3095
130*cdf0e10cSrcweir     0x0000,       // 0x3096
131*cdf0e10cSrcweir     0x0000,       // 0x3097
132*cdf0e10cSrcweir     0x0000,       // 0x3098
133*cdf0e10cSrcweir     0x0000,       // 0x3099 COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK
134*cdf0e10cSrcweir     0x0000,       // 0x309a COMBINING KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK
135*cdf0e10cSrcweir     0x0000,       // 0x309b KATAKANA-HIRAGANA VOICED SOUND MARK
136*cdf0e10cSrcweir     0x0000,       // 0x309c KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK
137*cdf0e10cSrcweir     0x0000,       // 0x309d HIRAGANA ITERATION MARK
138*cdf0e10cSrcweir     0x0000,       // 0x309e HIRAGANA VOICED ITERATION MARK
139*cdf0e10cSrcweir     0x0000,       // 0x309f
140*cdf0e10cSrcweir     0x0000,       // 0x30a0
141*cdf0e10cSrcweir     0x30a1,       // 0x30a1 KATAKANA LETTER SMALL A
142*cdf0e10cSrcweir     0x30a2,       // 0x30a2 KATAKANA LETTER A
143*cdf0e10cSrcweir     0x30a3,       // 0x30a3 KATAKANA LETTER SMALL I
144*cdf0e10cSrcweir     0x30a4,       // 0x30a4 KATAKANA LETTER I
145*cdf0e10cSrcweir     0x30a5,       // 0x30a5 KATAKANA LETTER SMALL U
146*cdf0e10cSrcweir     0x30a6,       // 0x30a6 KATAKANA LETTER U
147*cdf0e10cSrcweir     0x30a7,       // 0x30a7 KATAKANA LETTER SMALL E
148*cdf0e10cSrcweir     0x30a8,       // 0x30a8 KATAKANA LETTER E
149*cdf0e10cSrcweir     0x30a9,       // 0x30a9 KATAKANA LETTER SMALL O
150*cdf0e10cSrcweir     0x30aa,       // 0x30aa KATAKANA LETTER O
151*cdf0e10cSrcweir     0x30a2,       // 0x30ab KATAKANA LETTER KA
152*cdf0e10cSrcweir     0x30a2,       // 0x30ac KATAKANA LETTER GA
153*cdf0e10cSrcweir     0x30a4,       // 0x30ad KATAKANA LETTER KI
154*cdf0e10cSrcweir     0x30a4,       // 0x30ae KATAKANA LETTER GI
155*cdf0e10cSrcweir     0x30a6,       // 0x30af KATAKANA LETTER KU
156*cdf0e10cSrcweir     0x30a6,       // 0x30b0 KATAKANA LETTER GU
157*cdf0e10cSrcweir     0x30a8,       // 0x30b1 KATAKANA LETTER KE
158*cdf0e10cSrcweir     0x30a8,       // 0x30b2 KATAKANA LETTER GE
159*cdf0e10cSrcweir     0x30aa,       // 0x30b3 KATAKANA LETTER KO
160*cdf0e10cSrcweir     0x30aa,       // 0x30b4 KATAKANA LETTER GO
161*cdf0e10cSrcweir     0x30a2,       // 0x30b5 KATAKANA LETTER SA
162*cdf0e10cSrcweir     0x30a2,       // 0x30b6 KATAKANA LETTER ZA
163*cdf0e10cSrcweir     0x30a4,       // 0x30b7 KATAKANA LETTER SI
164*cdf0e10cSrcweir     0x30a4,       // 0x30b8 KATAKANA LETTER ZI
165*cdf0e10cSrcweir     0x30a6,       // 0x30b9 KATAKANA LETTER SU
166*cdf0e10cSrcweir     0x30a6,       // 0x30ba KATAKANA LETTER ZU
167*cdf0e10cSrcweir     0x30a8,       // 0x30bb KATAKANA LETTER SE
168*cdf0e10cSrcweir     0x30a8,       // 0x30bc KATAKANA LETTER ZE
169*cdf0e10cSrcweir     0x30aa,       // 0x30bd KATAKANA LETTER SO
170*cdf0e10cSrcweir     0x30aa,       // 0x30be KATAKANA LETTER ZO
171*cdf0e10cSrcweir     0x30a2,       // 0x30bf KATAKANA LETTER TA
172*cdf0e10cSrcweir     0x30a2,       // 0x30c0 KATAKANA LETTER DA
173*cdf0e10cSrcweir     0x30a4,       // 0x30c1 KATAKANA LETTER TI
174*cdf0e10cSrcweir     0x30a4,       // 0x30c2 KATAKANA LETTER DI
175*cdf0e10cSrcweir     0x30a5,       // 0x30c3 KATAKANA LETTER SMALL TU
176*cdf0e10cSrcweir     0x30a6,       // 0x30c4 KATAKANA LETTER TU
177*cdf0e10cSrcweir     0x30a6,       // 0x30c5 KATAKANA LETTER DU
178*cdf0e10cSrcweir     0x30a8,       // 0x30c6 KATAKANA LETTER TE
179*cdf0e10cSrcweir     0x30a8,       // 0x30c7 KATAKANA LETTER DE
180*cdf0e10cSrcweir     0x30aa,       // 0x30c8 KATAKANA LETTER TO
181*cdf0e10cSrcweir     0x30aa,       // 0x30c9 KATAKANA LETTER DO
182*cdf0e10cSrcweir     0x30a2,       // 0x30ca KATAKANA LETTER NA
183*cdf0e10cSrcweir     0x30a4,       // 0x30cb KATAKANA LETTER NI
184*cdf0e10cSrcweir     0x30a6,       // 0x30cc KATAKANA LETTER NU
185*cdf0e10cSrcweir     0x30a8,       // 0x30cd KATAKANA LETTER NE
186*cdf0e10cSrcweir     0x30aa,       // 0x30ce KATAKANA LETTER NO
187*cdf0e10cSrcweir     0x30a2,       // 0x30cf KATAKANA LETTER HA
188*cdf0e10cSrcweir     0x30a2,       // 0x30d0 KATAKANA LETTER BA
189*cdf0e10cSrcweir     0x30a2,       // 0x30d1 KATAKANA LETTER PA
190*cdf0e10cSrcweir     0x30a4,       // 0x30d2 KATAKANA LETTER HI
191*cdf0e10cSrcweir     0x30a4,       // 0x30d3 KATAKANA LETTER BI
192*cdf0e10cSrcweir     0x30a4,       // 0x30d4 KATAKANA LETTER PI
193*cdf0e10cSrcweir     0x30a6,       // 0x30d5 KATAKANA LETTER HU
194*cdf0e10cSrcweir     0x30a6,       // 0x30d6 KATAKANA LETTER BU
195*cdf0e10cSrcweir     0x30a6,       // 0x30d7 KATAKANA LETTER PU
196*cdf0e10cSrcweir     0x30a8,       // 0x30d8 KATAKANA LETTER HE
197*cdf0e10cSrcweir     0x30a8,       // 0x30d9 KATAKANA LETTER BE
198*cdf0e10cSrcweir     0x30a8,       // 0x30da KATAKANA LETTER PE
199*cdf0e10cSrcweir     0x30aa,       // 0x30db KATAKANA LETTER HO
200*cdf0e10cSrcweir     0x30aa,       // 0x30dc KATAKANA LETTER BO
201*cdf0e10cSrcweir     0x30aa,       // 0x30dd KATAKANA LETTER PO
202*cdf0e10cSrcweir     0x30a2,       // 0x30de KATAKANA LETTER MA
203*cdf0e10cSrcweir     0x30a4,       // 0x30df KATAKANA LETTER MI
204*cdf0e10cSrcweir     0x30a6,       // 0x30e0 KATAKANA LETTER MU
205*cdf0e10cSrcweir     0x30a8,       // 0x30e1 KATAKANA LETTER ME
206*cdf0e10cSrcweir     0x30aa,       // 0x30e2 KATAKANA LETTER MO
207*cdf0e10cSrcweir     0x30a1,       // 0x30e3 KATAKANA LETTER SMALL YA
208*cdf0e10cSrcweir     0x30a2,       // 0x30e4 KATAKANA LETTER YA
209*cdf0e10cSrcweir     0x30a5,       // 0x30e5 KATAKANA LETTER SMALL YU
210*cdf0e10cSrcweir     0x30a6,       // 0x30e6 KATAKANA LETTER YU
211*cdf0e10cSrcweir     0x30a9,       // 0x30e7 KATAKANA LETTER SMALL YO
212*cdf0e10cSrcweir     0x30aa,       // 0x30e8 KATAKANA LETTER YO
213*cdf0e10cSrcweir     0x30a2,       // 0x30e9 KATAKANA LETTER RA
214*cdf0e10cSrcweir     0x30a4,       // 0x30ea KATAKANA LETTER RI
215*cdf0e10cSrcweir     0x30a6,       // 0x30eb KATAKANA LETTER RU
216*cdf0e10cSrcweir     0x30a8,       // 0x30ec KATAKANA LETTER RE
217*cdf0e10cSrcweir     0x30aa,       // 0x30ed KATAKANA LETTER RO
218*cdf0e10cSrcweir     0x30a1,       // 0x30ee KATAKANA LETTER SMALL WA
219*cdf0e10cSrcweir     0x30a2,       // 0x30ef KATAKANA LETTER WA
220*cdf0e10cSrcweir     0x30a4,       // 0x30f0 KATAKANA LETTER WI
221*cdf0e10cSrcweir     0x30a8,       // 0x30f1 KATAKANA LETTER WE
222*cdf0e10cSrcweir     0x30aa,       // 0x30f2 KATAKANA LETTER WO
223*cdf0e10cSrcweir     0x0000,       // 0x30f3 KATAKANA LETTER N
224*cdf0e10cSrcweir     0x30a6,       // 0x30f4 KATAKANA LETTER VU
225*cdf0e10cSrcweir     0x30a1,       // 0x30f5 KATAKANA LETTER SMALL KA
226*cdf0e10cSrcweir     0x30a7,       // 0x30f6 KATAKANA LETTER SMALL KE
227*cdf0e10cSrcweir     0x30a2,       // 0x30f7 KATAKANA LETTER VA
228*cdf0e10cSrcweir     0x30a4,       // 0x30f8 KATAKANA LETTER VI
229*cdf0e10cSrcweir     0x30a8,       // 0x30f9 KATAKANA LETTER VE
230*cdf0e10cSrcweir     0x30aa        // 0x30fa KATAKANA LETTER VO
231*cdf0e10cSrcweir     //  0x0000,   // 0x30fb KATAKANA MIDDLE DOT
232*cdf0e10cSrcweir     //  0x0000,   // 0x30fc KATAKANA-HIRAGANA PROLONGED SOUND MARK
233*cdf0e10cSrcweir     //  0x0000,   // 0x30fd KATAKANA ITERATION MARK
234*cdf0e10cSrcweir     //  0x0000,   // 0x30fe KATAKANA VOICED ITERATION MARK
235*cdf0e10cSrcweir     //  0x0000    // 0x30ff
236*cdf0e10cSrcweir };
237*cdf0e10cSrcweir 
238*cdf0e10cSrcweir static sal_Unicode table_halfwidth[] = {
239*cdf0e10cSrcweir     //  0x0000,   // 0xff61 HALFWIDTH IDEOGRAPHIC FULL STOP
240*cdf0e10cSrcweir     //  0x0000,   // 0xff62 HALFWIDTH LEFT CORNER BRACKET
241*cdf0e10cSrcweir     //  0x0000,   // 0xff63 HALFWIDTH RIGHT CORNER BRACKET
242*cdf0e10cSrcweir     //  0x0000,   // 0xff64 HALFWIDTH IDEOGRAPHIC COMMA
243*cdf0e10cSrcweir     //  0x0000,   // 0xff65 HALFWIDTH KATAKANA MIDDLE DOT
244*cdf0e10cSrcweir     0xff75,       // 0xff66 HALFWIDTH KATAKANA LETTER WO
245*cdf0e10cSrcweir     0xff67,       // 0xff67 HALFWIDTH KATAKANA LETTER SMALL A
246*cdf0e10cSrcweir     0xff68,       // 0xff68 HALFWIDTH KATAKANA LETTER SMALL I
247*cdf0e10cSrcweir     0xff69,       // 0xff69 HALFWIDTH KATAKANA LETTER SMALL U
248*cdf0e10cSrcweir     0xff6a,       // 0xff6a HALFWIDTH KATAKANA LETTER SMALL E
249*cdf0e10cSrcweir     0xff6b,       // 0xff6b HALFWIDTH KATAKANA LETTER SMALL O
250*cdf0e10cSrcweir     0xff67,       // 0xff6c HALFWIDTH KATAKANA LETTER SMALL YA
251*cdf0e10cSrcweir     0xff69,       // 0xff6d HALFWIDTH KATAKANA LETTER SMALL YU
252*cdf0e10cSrcweir     0xff6b,       // 0xff6e HALFWIDTH KATAKANA LETTER SMALL YO
253*cdf0e10cSrcweir     0xff69,       // 0xff6f HALFWIDTH KATAKANA LETTER SMALL TU
254*cdf0e10cSrcweir     0x0000,       // 0xff70 HALFWIDTH KATAKANA-HIRAGANA PROLONGED SOUND MARK
255*cdf0e10cSrcweir     0xff71,       // 0xff71 HALFWIDTH KATAKANA LETTER A
256*cdf0e10cSrcweir     0xff72,       // 0xff72 HALFWIDTH KATAKANA LETTER I
257*cdf0e10cSrcweir     0xff73,       // 0xff73 HALFWIDTH KATAKANA LETTER U
258*cdf0e10cSrcweir     0xff74,       // 0xff74 HALFWIDTH KATAKANA LETTER E
259*cdf0e10cSrcweir     0xff75,       // 0xff75 HALFWIDTH KATAKANA LETTER O
260*cdf0e10cSrcweir     0xff71,       // 0xff76 HALFWIDTH KATAKANA LETTER KA
261*cdf0e10cSrcweir     0xff72,       // 0xff77 HALFWIDTH KATAKANA LETTER KI
262*cdf0e10cSrcweir     0xff73,       // 0xff78 HALFWIDTH KATAKANA LETTER KU
263*cdf0e10cSrcweir     0xff74,       // 0xff79 HALFWIDTH KATAKANA LETTER KE
264*cdf0e10cSrcweir     0xff75,       // 0xff7a HALFWIDTH KATAKANA LETTER KO
265*cdf0e10cSrcweir     0xff71,       // 0xff7b HALFWIDTH KATAKANA LETTER SA
266*cdf0e10cSrcweir     0xff72,       // 0xff7c HALFWIDTH KATAKANA LETTER SI
267*cdf0e10cSrcweir     0xff73,       // 0xff7d HALFWIDTH KATAKANA LETTER SU
268*cdf0e10cSrcweir     0xff74,       // 0xff7e HALFWIDTH KATAKANA LETTER SE
269*cdf0e10cSrcweir     0xff75,       // 0xff7f HALFWIDTH KATAKANA LETTER SO
270*cdf0e10cSrcweir     0xff71,       // 0xff80 HALFWIDTH KATAKANA LETTER TA
271*cdf0e10cSrcweir     0xff72,       // 0xff81 HALFWIDTH KATAKANA LETTER TI
272*cdf0e10cSrcweir     0xff73,       // 0xff82 HALFWIDTH KATAKANA LETTER TU
273*cdf0e10cSrcweir     0xff74,       // 0xff83 HALFWIDTH KATAKANA LETTER TE
274*cdf0e10cSrcweir     0xff75,       // 0xff84 HALFWIDTH KATAKANA LETTER TO
275*cdf0e10cSrcweir     0xff71,       // 0xff85 HALFWIDTH KATAKANA LETTER NA
276*cdf0e10cSrcweir     0xff72,       // 0xff86 HALFWIDTH KATAKANA LETTER NI
277*cdf0e10cSrcweir     0xff73,       // 0xff87 HALFWIDTH KATAKANA LETTER NU
278*cdf0e10cSrcweir     0xff74,       // 0xff88 HALFWIDTH KATAKANA LETTER NE
279*cdf0e10cSrcweir     0xff75,       // 0xff89 HALFWIDTH KATAKANA LETTER NO
280*cdf0e10cSrcweir     0xff71,       // 0xff8a HALFWIDTH KATAKANA LETTER HA
281*cdf0e10cSrcweir     0xff72,       // 0xff8b HALFWIDTH KATAKANA LETTER HI
282*cdf0e10cSrcweir     0xff73,       // 0xff8c HALFWIDTH KATAKANA LETTER HU
283*cdf0e10cSrcweir     0xff74,       // 0xff8d HALFWIDTH KATAKANA LETTER HE
284*cdf0e10cSrcweir     0xff75,       // 0xff8e HALFWIDTH KATAKANA LETTER HO
285*cdf0e10cSrcweir     0xff71,       // 0xff8f HALFWIDTH KATAKANA LETTER MA
286*cdf0e10cSrcweir     0xff72,       // 0xff90 HALFWIDTH KATAKANA LETTER MI
287*cdf0e10cSrcweir     0xff73,       // 0xff91 HALFWIDTH KATAKANA LETTER MU
288*cdf0e10cSrcweir     0xff74,       // 0xff92 HALFWIDTH KATAKANA LETTER ME
289*cdf0e10cSrcweir     0xff75,       // 0xff93 HALFWIDTH KATAKANA LETTER MO
290*cdf0e10cSrcweir     0xff71,       // 0xff94 HALFWIDTH KATAKANA LETTER YA
291*cdf0e10cSrcweir     0xff73,       // 0xff95 HALFWIDTH KATAKANA LETTER YU
292*cdf0e10cSrcweir     0xff75,       // 0xff96 HALFWIDTH KATAKANA LETTER YO
293*cdf0e10cSrcweir     0xff71,       // 0xff97 HALFWIDTH KATAKANA LETTER RA
294*cdf0e10cSrcweir     0xff72,       // 0xff98 HALFWIDTH KATAKANA LETTER RI
295*cdf0e10cSrcweir     0xff73,       // 0xff99 HALFWIDTH KATAKANA LETTER RU
296*cdf0e10cSrcweir     0xff74,       // 0xff9a HALFWIDTH KATAKANA LETTER RE
297*cdf0e10cSrcweir     0xff75,       // 0xff9b HALFWIDTH KATAKANA LETTER RO
298*cdf0e10cSrcweir     0xff71        // 0xff9c HALFWIDTH KATAKANA LETTER WA
299*cdf0e10cSrcweir     //  0x0000,   // 0xff9d HALFWIDTH KATAKANA LETTER N
300*cdf0e10cSrcweir     //  0x0000,   // 0xff9e HALFWIDTH KATAKANA VOICED SOUND MARK
301*cdf0e10cSrcweir     //  0x0000    // 0xff9f HALFWIDTH KATAKANA SEMI-VOICED SOUND MARK
302*cdf0e10cSrcweir };
303*cdf0e10cSrcweir 
304*cdf0e10cSrcweir 
305*cdf0e10cSrcweir OUString SAL_CALL
306*cdf0e10cSrcweir ignoreProlongedSoundMark_ja_JP::folding( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, Sequence< sal_Int32 >& offset )
307*cdf0e10cSrcweir   throw(RuntimeException)
308*cdf0e10cSrcweir {
309*cdf0e10cSrcweir     // Create a string buffer which can hold nCount + 1 characters.
310*cdf0e10cSrcweir     // The reference count is 0 now.
311*cdf0e10cSrcweir     rtl_uString * newStr = x_rtl_uString_new_WithLength( nCount ); // defined in x_rtl_ustring.h
312*cdf0e10cSrcweir     sal_Unicode * dst = newStr->buffer;
313*cdf0e10cSrcweir     const sal_Unicode * src = inStr.getStr() + startPos;
314*cdf0e10cSrcweir 
315*cdf0e10cSrcweir     sal_Int32 *p = 0;
316*cdf0e10cSrcweir 	sal_Int32 position = 0;
317*cdf0e10cSrcweir 
318*cdf0e10cSrcweir     if (useOffset) {
319*cdf0e10cSrcweir         // Allocate nCount length to offset argument.
320*cdf0e10cSrcweir         offset.realloc( nCount );
321*cdf0e10cSrcweir         p = offset.getArray();
322*cdf0e10cSrcweir         position = startPos;
323*cdf0e10cSrcweir     }
324*cdf0e10cSrcweir 
325*cdf0e10cSrcweir     //
326*cdf0e10cSrcweir     sal_Unicode previousChar = *src ++;
327*cdf0e10cSrcweir     sal_Unicode currentChar;
328*cdf0e10cSrcweir 
329*cdf0e10cSrcweir     // Conversion
330*cdf0e10cSrcweir     while (-- nCount > 0) {
331*cdf0e10cSrcweir         currentChar = *src ++;
332*cdf0e10cSrcweir 
333*cdf0e10cSrcweir         if (currentChar == 0x30fc || // KATAKANA-HIRAGANA PROLONGED SOUND MARK
334*cdf0e10cSrcweir                 currentChar == 0xff70) { // HALFWIDTH KATAKANA-HIRAGANA PROLONGED SOUND MARK
335*cdf0e10cSrcweir 
336*cdf0e10cSrcweir             if (0x3041 <= previousChar && previousChar <= 0x30fa) {
337*cdf0e10cSrcweir                 currentChar = table_normalwidth[ previousChar - 0x3041 ];
338*cdf0e10cSrcweir             }
339*cdf0e10cSrcweir             else if (0xff66 <= previousChar && previousChar <= 0xff9c) {
340*cdf0e10cSrcweir                 currentChar = table_halfwidth[ previousChar - 0xff66 ];
341*cdf0e10cSrcweir             }
342*cdf0e10cSrcweir         }
343*cdf0e10cSrcweir 
344*cdf0e10cSrcweir         if (useOffset)
345*cdf0e10cSrcweir             *p ++ = position ++;
346*cdf0e10cSrcweir         *dst ++ = previousChar;
347*cdf0e10cSrcweir         previousChar = currentChar;
348*cdf0e10cSrcweir     }
349*cdf0e10cSrcweir 
350*cdf0e10cSrcweir     if (nCount == 0) {
351*cdf0e10cSrcweir         if (useOffset)
352*cdf0e10cSrcweir             *p = position;
353*cdf0e10cSrcweir         *dst ++ = previousChar;
354*cdf0e10cSrcweir     }
355*cdf0e10cSrcweir 
356*cdf0e10cSrcweir     *dst = (sal_Unicode) 0;
357*cdf0e10cSrcweir 
358*cdf0e10cSrcweir     newStr->length = sal_Int32(dst - newStr->buffer);
359*cdf0e10cSrcweir     if (useOffset)
360*cdf0e10cSrcweir         offset.realloc(newStr->length);
361*cdf0e10cSrcweir     return OUString( newStr ); // defined in rtl/usrting. The reference count is increased from 0 to 1.
362*cdf0e10cSrcweir 
363*cdf0e10cSrcweir }
364*cdf0e10cSrcweir 
365*cdf0e10cSrcweir } } } }
366