|
1 // Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 #include "TCharsetvCard.h" |
|
17 |
|
18 // System includes |
|
19 #include <versit.h> |
|
20 #include <f32file.h> |
|
21 #include <e32test.h> |
|
22 #include <charconv.h> |
|
23 |
|
24 // Literal constants |
|
25 _LIT(KTestName, "TCharSetvCard"); |
|
26 |
|
27 // Globals |
|
28 static RFs TheFsSession; |
|
29 //static CTrapCleanup* TheCleanup; |
|
30 static RTest TheTest(KTestName); |
|
31 |
|
32 static void FileCleanup(TAny * aFileMan) |
|
33 { |
|
34 CFileMan* FileMan = (CFileMan*)aFileMan; |
|
35 FileMan->RmDir(_L("C:\\OutputTestvCards\\")); |
|
36 } |
|
37 |
|
38 static void DoTestsL() |
|
39 { |
|
40 CFileMan* FileMan = CFileMan::NewL(TheFsSession); |
|
41 CleanupStack::PushL(FileMan); |
|
42 CleanupStack::PushL(TCleanupItem(FileCleanup, FileMan)); |
|
43 CVersitCardTest* test = CVersitCardTest::NewLC(); |
|
44 test->StartTestsL(); |
|
45 CleanupStack::PopAndDestroy(3, FileMan); // filecleanup, test |
|
46 } |
|
47 |
|
48 |
|
49 /** |
|
50 @SYMTestCaseID PIM-TCHARSETVCARD-0001 |
|
51 */ |
|
52 GLDEF_C TInt E32Main() |
|
53 { |
|
54 |
|
55 TTime startTime; |
|
56 startTime.UniversalTime(); |
|
57 |
|
58 __UHEAP_MARK; |
|
59 CTrapCleanup* TheCleanup = CTrapCleanup::New(); |
|
60 if (!TheCleanup) |
|
61 return KErrNoMemory; |
|
62 |
|
63 if (TheFsSession.Connect() < KErrNone) |
|
64 return KErrGeneral; |
|
65 |
|
66 TheTest.Start(_L("@SYMTestCaseID PIM-TCHARSETVCARD-0001 TCharSetvCard")); |
|
67 TRAPD(error, DoTestsL()); |
|
68 TheTest(error == KErrNone); |
|
69 TheTest.End(); |
|
70 TheTest.Close(); |
|
71 TheFsSession.Close(); |
|
72 |
|
73 delete TheCleanup; |
|
74 __UHEAP_MARKEND; |
|
75 |
|
76 TTime finishTime; |
|
77 finishTime.UniversalTime(); |
|
78 TReal elapsed = (TReal)finishTime.MicroSecondsFrom(startTime).Int64(); |
|
79 TheTest.Printf(_L("Elapsed time: %.4f\n"), elapsed/1000000); |
|
80 |
|
81 return KErrNone; |
|
82 } |
|
83 |
|
84 |
|
85 |
|
86 |
|
87 // |
|
88 // ------> CVersitCardTest (source) |
|
89 // |
|
90 |
|
91 //******************************************************************************************** |
|
92 CVersitCardTest::~CVersitCardTest() |
|
93 { |
|
94 delete iDirectoryScanner; |
|
95 delete iArrayOfCharacterSetsAvailable; |
|
96 } |
|
97 |
|
98 |
|
99 //******************************************************************************************** |
|
100 void CVersitCardTest::ConstructL() |
|
101 { |
|
102 iDirectoryScanner = CDirScan::NewL(TheFsSession); |
|
103 iArrayOfCharacterSetsAvailable = CCnvCharacterSetConverter::CreateArrayOfCharacterSetsAvailableL(TheFsSession); |
|
104 } |
|
105 |
|
106 |
|
107 //******************************************************************************************** |
|
108 CVersitCardTest* CVersitCardTest::NewLC() |
|
109 { |
|
110 CVersitCardTest* self = new(ELeave) CVersitCardTest; |
|
111 CleanupStack::PushL(self); |
|
112 self->ConstructL(); |
|
113 return self; |
|
114 } |
|
115 |
|
116 |
|
117 // |
|
118 // |
|
119 // |
|
120 |
|
121 |
|
122 //******************************************************************************************** |
|
123 void CVersitCardTest::StartTestsL() |
|
124 { |
|
125 /* |
|
126 CParserVCard* parser; |
|
127 |
|
128 parser = new(ELeave) CParserVCard(); |
|
129 CleanupStack::PushL(parser); |
|
130 InternalizeCardL(_L("C:\\Testvcards\\Encoded\\2.vcf"), *parser, CVersitParser::EUSAsciiCharSet, CVersitParser::ENoEncoding); |
|
131 ExternalizeCardL(_L("C:\\2.vcf"), *parser, CVersitParser::EUSAsciiCharSet, CVersitParser::ENoEncoding); |
|
132 CleanupStack::PopAndDestroy(); // parser |
|
133 |
|
134 return; |
|
135 parser = new(ELeave) CParserVCard(); |
|
136 CleanupStack::PushL(parser); |
|
137 InternalizeCardL(_L("C:\\Testvcards\\Various\\9.vcf"), *parser, CVersitParser::EISO88591CharSet, CVersitParser::ENoEncoding); |
|
138 //ExternalizeCardL(_L("C:\\vCard-jis.vcf"), *parser, CVersitParser::EJISCharSet, CVersitParser::ENoEncoding); |
|
139 CleanupStack::PopAndDestroy(); // parser |
|
140 |
|
141 |
|
142 return; |
|
143 CParserVCard* parser; |
|
144 |
|
145 parser = new(ELeave) CParserVCard(); |
|
146 CleanupStack::PushL(parser); |
|
147 InternalizeCardL(_L("C:\\Testvcards\\Encoded\\1.vcf"), *parser, CVersitParser::EISO88591CharSet, CVersitParser::ENoEncoding); |
|
148 ExternalizeCardL(_L("C:\\vCard-shiftjis.vcf"), *parser, CVersitParser::EShiftJISCharSet, CVersitParser::ENoEncoding); |
|
149 CleanupStack::PopAndDestroy(); // parser |
|
150 |
|
151 // Read ISO-1 -> Write JIS |
|
152 parser = new(ELeave) CParserVCard(); |
|
153 CleanupStack::PushL(parser); |
|
154 InternalizeCardL(_L("C:\\Testvcards\\Encoded\\1.vcf"), *parser, CVersitParser::EISO88591CharSet, CVersitParser::ENoEncoding); |
|
155 ExternalizeCardL(_L("C:\\vCard-jis.vcf"), *parser, CVersitParser::EJISCharSet, CVersitParser::ENoEncoding); |
|
156 CleanupStack::PopAndDestroy(); // parser |
|
157 |
|
158 // Read ShiftJIS -> Write ISO-1 |
|
159 parser = new(ELeave) CParserVCard(); |
|
160 CleanupStack::PushL(parser); |
|
161 InternalizeCardL(_L("C:\\vCard-shiftjis.vcf"), *parser, CVersitParser::EShiftJISCharSet, CVersitParser::ENoEncoding); |
|
162 ExternalizeCardL(_L("C:\\vCard-iso1-from-shiftjis.vcf"), *parser, CVersitParser::EISO88591CharSet, CVersitParser::ENoEncoding); |
|
163 CleanupStack::PopAndDestroy(); // parser |
|
164 |
|
165 // Read JIS -> Write ISO-1 |
|
166 parser = new(ELeave) CParserVCard(); |
|
167 CleanupStack::PushL(parser); |
|
168 InternalizeCardL(_L("C:\\vCard-jis.vcf"), *parser, CVersitParser::EJISCharSet, CVersitParser::ENoEncoding); |
|
169 ExternalizeCardL(_L("C:\\vCard-iso1-from-jis.vcf"), *parser, CVersitParser::EISO88591CharSet, CVersitParser::ENoEncoding); |
|
170 CleanupStack::PopAndDestroy(); // parser |
|
171 */ |
|
172 |
|
173 _LIT(KTestDataDirectory, "Z:\\TestvCards\\"); |
|
174 _LIT(KvCardExtension, ".vCF"); |
|
175 |
|
176 iDirectoryScanner->SetScanDataL(KTestDataDirectory, KEntryAttDir, ESortByExt|EAscending, CDirScan::EScanUpTree); |
|
177 |
|
178 CDir* dirList = NULL; |
|
179 |
|
180 // Fetch next dir |
|
181 FOREVER |
|
182 { |
|
183 iDirectoryScanner->NextL(dirList); |
|
184 if (!dirList) |
|
185 break; |
|
186 CleanupStack::PushL(dirList); |
|
187 |
|
188 TPtrC path(iDirectoryScanner->FullPath()); |
|
189 |
|
190 const TInt count = dirList->Count(); |
|
191 for(TInt i=0; i<count; i++) |
|
192 { |
|
193 const TEntry& entry = (*dirList)[i]; |
|
194 |
|
195 TFileName file(path); |
|
196 file += entry.iName; |
|
197 |
|
198 // Check for vCards |
|
199 TParsePtrC parser(file); |
|
200 if (parser.Ext().CompareF(KvCardExtension) != 0) |
|
201 continue; |
|
202 |
|
203 // We've got a vCard so internalize it |
|
204 CParserVCard* cardParser = CParserVCard::NewL(); |
|
205 CleanupStack::PushL(cardParser); |
|
206 |
|
207 // Internalize & externalize the card |
|
208 TheTest.Next(file); |
|
209 TheTest.Start(KNullDesC); |
|
210 |
|
211 TRAPD(err, InternalizeAndExternalizeCardL(file, *cardParser)); |
|
212 TheTest.End(); |
|
213 CleanupStack::PopAndDestroy(); // cardParser |
|
214 |
|
215 |
|
216 // Handling for invalid cards |
|
217 if (err < KErrNone) |
|
218 { |
|
219 if (file.Find(_L("\\invalid\\")) >= KErrNone) |
|
220 { |
|
221 // This was an invalid cards, but it's ok for versit |
|
222 // to leave if this is the case... |
|
223 continue; |
|
224 } |
|
225 } |
|
226 } |
|
227 |
|
228 CleanupStack::PopAndDestroy(); // dirList |
|
229 |
|
230 } |
|
231 } |
|
232 |
|
233 |
|
234 // |
|
235 // |
|
236 // |
|
237 |
|
238 |
|
239 //******************************************************************************************** |
|
240 void CVersitCardTest::InternalizeAndExternalizeCardL(const TDesC& aFile, CParserVCard& aParser) const |
|
241 { |
|
242 _LIT(KSpacer, " - "); |
|
243 //_LIT(KCharset, "CharSet="); |
|
244 //_LIT(KEncoding, "Encoding="); |
|
245 _LIT(KTestOutputDirPrefix, "Output"); |
|
246 |
|
247 TParsePtrC outputDirParser(aFile); |
|
248 TFileName outputDir; |
|
249 |
|
250 // Make output directory |
|
251 outputDir += outputDirParser.Drive(); |
|
252 outputDir.Append('\\'); |
|
253 outputDir += KTestOutputDirPrefix; |
|
254 { |
|
255 TInt length = outputDir.Length(); |
|
256 outputDir += outputDirParser.Path(); |
|
257 outputDir.Delete(length, 1); |
|
258 outputDir += outputDirParser.Name(); |
|
259 outputDir.Append('\\'); |
|
260 TheFsSession.MkDirAll(outputDir); |
|
261 } |
|
262 |
|
263 { |
|
264 // Guess the charset of the vCard |
|
265 TUint charConvCharSet = AutoDetectCharacterSetL(TheFsSession, aFile); |
|
266 |
|
267 // Map to versit charset |
|
268 Versit::TVersitCharSet charSet = MapCharConvCharSetToVersitCharSet(charConvCharSet); |
|
269 |
|
270 TFileName testName(aFile); |
|
271 testName += _L(" ["); |
|
272 testName += CharsetAsDescriptor(charSet); |
|
273 testName += _L("]"); |
|
274 |
|
275 // Dump test title |
|
276 TheTest.Next(testName); |
|
277 |
|
278 // Internalize it |
|
279 InternalizeCardL(aFile, aParser, charSet, Versit::ENoEncoding); |
|
280 } |
|
281 |
|
282 TInt countCharSets = Versit::EJISCharSet; |
|
283 for(TInt i=Versit::EUSAsciiCharSet; i<=countCharSets; i++) |
|
284 { |
|
285 // Get charset |
|
286 Versit::TVersitCharSet charSet = static_cast<Versit::TVersitCharSet>(i); |
|
287 |
|
288 TInt countEncodings = Versit::EBase64Encoding; |
|
289 for(TInt j=Versit::ENoEncoding; j<=countEncodings; j++) |
|
290 { |
|
291 Versit::TVersitEncoding encoding = static_cast<Versit::TVersitEncoding>(j); |
|
292 |
|
293 // Generate filename |
|
294 TFileName file(outputDir); |
|
295 file += CharsetAsDescriptor(charSet); |
|
296 file += KSpacer; |
|
297 file += EncodingAsDescriptor(encoding); |
|
298 file += outputDirParser.Ext(); |
|
299 |
|
300 // Write test |
|
301 { |
|
302 TParsePtrC testNameParser(file); |
|
303 TName name(testNameParser.NameAndExt()); |
|
304 name.Insert(0, _L("\t")); |
|
305 TheTest.Next(name); |
|
306 } |
|
307 |
|
308 // Externalize |
|
309 ExternalizeCardL(file, aParser, charSet, encoding); |
|
310 } |
|
311 } |
|
312 } |
|
313 |
|
314 |
|
315 //******************************************************************************************** |
|
316 //void CVersitCardTest::InternalizeCardL(const TDesC& aFile, CParserVCard& aParser, CVersitParser::TVersitCharSet aCharSet, CVersitParser::TVersitEncoding aEncoding) const |
|
317 void CVersitCardTest::InternalizeCardL(const TDesC& aFile, CParserVCard& aParser, Versit::TVersitCharSet aCharSet, Versit::TVersitEncoding aEncoding) const |
|
318 // |
|
319 // Internalize the specified file |
|
320 // |
|
321 { |
|
322 TInt pos = 0; |
|
323 RFile file; |
|
324 User::LeaveIfError(file.Open(TheFsSession, aFile, EFileRead)); |
|
325 CleanupClosePushL(file); |
|
326 |
|
327 // Set defaults |
|
328 aParser.SetDefaultEncoding(aEncoding); |
|
329 aParser.SetDefaultCharSet(aCharSet); |
|
330 |
|
331 // Read from the file |
|
332 static_cast<CVersitParser&>(aParser).InternalizeL(file, pos); |
|
333 |
|
334 CleanupStack::PopAndDestroy(); // file |
|
335 } |
|
336 |
|
337 |
|
338 //******************************************************************************************** |
|
339 //void CVersitCardTest::ExternalizeCardL(const TDesC& aFile, CParserVCard& aParser, CVersitParser::TVersitCharSet aCharSet, CVersitParser::TVersitEncoding aEncoding) const |
|
340 void CVersitCardTest::ExternalizeCardL(const TDesC& aFile, CParserVCard& aParser, Versit::TVersitCharSet aCharSet, Versit::TVersitEncoding aEncoding) const |
|
341 // |
|
342 // Externalize the specified file |
|
343 // |
|
344 { |
|
345 RFile file; |
|
346 User::LeaveIfError(file.Replace(TheFsSession, aFile, EFileWrite)); |
|
347 CleanupClosePushL(file); |
|
348 |
|
349 // Set defaults |
|
350 aParser.SetDefaultEncoding(aEncoding); |
|
351 aParser.SetDefaultCharSet(aCharSet); |
|
352 |
|
353 // Write from the file |
|
354 static_cast<CVersitParser&>(aParser).ExternalizeL(file); |
|
355 |
|
356 CleanupStack::PopAndDestroy(); // file |
|
357 } |
|
358 |
|
359 |
|
360 //******************************************************************************************** |
|
361 //const TDesC& CVersitCardTest::CharsetAsDescriptor(CVersitParser::TVersitCharSet aCharSet) |
|
362 const TDesC& CVersitCardTest::CharsetAsDescriptor(Versit::TVersitCharSet aCharSet) |
|
363 { |
|
364 _LIT(KVersitCharSetASCII, "ASCII"); |
|
365 _LIT(KVersitCharSetUTF8, "UTF8"); |
|
366 _LIT(KVersitCharSetUTF7, "UTF7"); |
|
367 _LIT(KVersitCharSetISO_8859_1, "ISO-8859-1"); |
|
368 _LIT(KVersitCharSetISO_8859_2, "ISO-8859-2"); |
|
369 _LIT(KVersitCharSetISO_8859_4, "ISO-8859-4"); |
|
370 _LIT(KVersitCharSetISO_8859_5, "ISO-8859-5"); |
|
371 _LIT(KVersitCharSetISO_8859_7, "ISO-8859-7"); |
|
372 _LIT(KVersitCharSetISO_8859_9, "ISO-8859-9"); |
|
373 _LIT(KVersitCharSetISO_8859_3, "ISO-8859-3"); |
|
374 _LIT(KVersitCharSetISO_8859_0, "ISO-8859-0"); |
|
375 _LIT(KVersitCharSetGB_231280, "GB-231280"); |
|
376 _LIT(KVersitCharSetGBK, "GBK"); |
|
377 _LIT(KVersitCharSetBIG5, "BIG5"); |
|
378 _LIT(KVersitCharSetISO_2022JP, "ISO-2022JP"); |
|
379 _LIT(KVersitCharSetEUCJP, "EUCJP"); |
|
380 _LIT(KVersitCharSetShiftJIS, "ShiftJIS"); |
|
381 _LIT(KVersitCharSetJIS, "JIS"); |
|
382 // |
|
383 switch(aCharSet) |
|
384 { |
|
385 default: |
|
386 case Versit::EUSAsciiCharSet: |
|
387 return KVersitCharSetASCII; |
|
388 case Versit::EUTF8CharSet: |
|
389 return KVersitCharSetUTF8; |
|
390 case Versit::EUTF7CharSet: |
|
391 return KVersitCharSetUTF7; |
|
392 case Versit::EISO88591CharSet: |
|
393 return KVersitCharSetISO_8859_1; |
|
394 case Versit::EISO88592CharSet: |
|
395 return KVersitCharSetISO_8859_2; |
|
396 case Versit::EISO88594CharSet: |
|
397 return KVersitCharSetISO_8859_4; |
|
398 case Versit::EISO88595CharSet: |
|
399 return KVersitCharSetISO_8859_5; |
|
400 case Versit::EISO88597CharSet: |
|
401 return KVersitCharSetISO_8859_7; |
|
402 case Versit::EISO88599CharSet: |
|
403 return KVersitCharSetISO_8859_9; |
|
404 case Versit::EISO88593CharSet: |
|
405 return KVersitCharSetISO_8859_3; |
|
406 case Versit::EISO885910CharSet: |
|
407 return KVersitCharSetISO_8859_0; |
|
408 case Versit::EGB231280CharSet: |
|
409 return KVersitCharSetGB_231280; |
|
410 case Versit::EGBKCharSet: |
|
411 return KVersitCharSetGBK; |
|
412 case Versit::EBIG5CharSet: |
|
413 return KVersitCharSetBIG5; |
|
414 case Versit::EISO2022JPCharSet: |
|
415 return KVersitCharSetISO_2022JP; |
|
416 case Versit::EEUCJPCharSet: |
|
417 return KVersitCharSetEUCJP; |
|
418 case Versit::EShiftJISCharSet: |
|
419 return KVersitCharSetShiftJIS; |
|
420 case Versit::EJISCharSet: |
|
421 return KVersitCharSetJIS; |
|
422 } |
|
423 } |
|
424 |
|
425 |
|
426 //******************************************************************************************** |
|
427 const TDesC& CVersitCardTest::EncodingAsDescriptor(Versit::TVersitEncoding aEncoding) |
|
428 { |
|
429 _LIT(KVersitEncodingNone, "None"); |
|
430 _LIT(KVersitEncodingQP, "Quoted Printable"); |
|
431 _LIT(KVersitEncodingBase64, "Base64"); |
|
432 // |
|
433 switch(aEncoding) |
|
434 { |
|
435 default: |
|
436 case Versit::ENoEncoding: |
|
437 return KVersitEncodingNone; |
|
438 case Versit::EQuotedPrintableEncoding: |
|
439 return KVersitEncodingQP; |
|
440 case Versit::EBase64Encoding: |
|
441 return KVersitEncodingBase64; |
|
442 } |
|
443 } |
|
444 |
|
445 |
|
446 //******************************************************************************************** |
|
447 TUint CVersitCardTest::AutoDetectCharacterSetL(RFs& aFsSession, const TDesC& aFile) const |
|
448 { |
|
449 _LIT8(KCharset, "CHARSET"); |
|
450 _LIT8(KBase64, "BASE64"); |
|
451 |
|
452 RFile file; |
|
453 User::LeaveIfError(file.Open(aFsSession, aFile, EFileRead)); |
|
454 |
|
455 // Read a bit of the file |
|
456 TBuf8<400> sample; |
|
457 file.Read(sample); // ignore error |
|
458 file.Close(); |
|
459 |
|
460 const TInt length = sample.Length(); |
|
461 if (!length) |
|
462 User::Leave(KErrUnderflow); |
|
463 |
|
464 // First of all, try and find a charset identifier in the vCard... |
|
465 TInt pos = sample.Find(KCharset); |
|
466 if (pos >= KErrNone) |
|
467 { |
|
468 // There is a charset line, so read until we hit a = |
|
469 while(pos < length && sample[pos] != '=') |
|
470 pos++; |
|
471 |
|
472 // Did we find the '=' ? |
|
473 if (pos < length && sample[pos] == '=') |
|
474 { |
|
475 // Yes, so mark the start |
|
476 TInt start = ++pos; |
|
477 |
|
478 // There is a charset line, so read until we hit a : or a ; |
|
479 while(pos < length && !(sample[pos] == ';' || sample[pos] == ':')) |
|
480 pos++; |
|
481 |
|
482 // Did we find the ':' or ';' ? |
|
483 if (pos < length && sample[pos] == ';' || sample[pos] == ':') |
|
484 { |
|
485 // We now have a range for the charset identifier |
|
486 TPtrC8 pCharset(sample.Mid(start, pos-start)); |
|
487 |
|
488 // Attempt to ask CharConv to identify it... |
|
489 CCnvCharacterSetConverter* charConv = CCnvCharacterSetConverter::NewLC(); |
|
490 TUint charset = charConv->ConvertStandardNameOfCharacterSetToIdentifierL(pCharset, TheFsSession); |
|
491 CleanupStack::PopAndDestroy(); // charConv |
|
492 |
|
493 // Charconv returns 0 if it doesn't recognize it |
|
494 if (charset) |
|
495 return charset; |
|
496 } |
|
497 } |
|
498 } |
|
499 // See if we can find a BASE64 marker... if we can then ignore everything |
|
500 // before this point in the stream, since it confuses CharConv |
|
501 pos = sample.Find(KBase64); |
|
502 if (pos >= KErrNone) |
|
503 { |
|
504 // Snip off anything after this point |
|
505 sample = sample.Left(pos); |
|
506 } |
|
507 |
|
508 // Attempt to detect charset |
|
509 TUint charset = 0; |
|
510 TInt confidence = 0; |
|
511 CCnvCharacterSetConverter::AutoDetectCharacterSetL(confidence, charset, *iArrayOfCharacterSetsAvailable, sample); |
|
512 if (!confidence) |
|
513 return KCharacterSetIdentifierAscii; |
|
514 return charset; |
|
515 } |
|
516 |
|
517 |
|
518 //******************************************************************************************** |
|
519 Versit::TVersitCharSet CVersitCardTest::MapCharConvCharSetToVersitCharSet(TUint aCharConvCharSet) |
|
520 { |
|
521 switch(aCharConvCharSet) |
|
522 { |
|
523 case KCharacterSetIdentifierAscii: |
|
524 case KCharacterSetIdentifierIso88596: |
|
525 case KCharacterSetIdentifierIso88598: |
|
526 case KCharacterSetIdentifierCodePage1252: |
|
527 return Versit::EUSAsciiCharSet; |
|
528 case KCharacterSetIdentifierUtf8: |
|
529 case KCharacterSetIdentifierJavaConformantUtf8: |
|
530 return Versit::EUTF8CharSet; |
|
531 case KCharacterSetIdentifierUtf7: |
|
532 case KCharacterSetIdentifierImapUtf7: |
|
533 return Versit::EUTF7CharSet; |
|
534 case KCharacterSetIdentifierIso88591: |
|
535 return Versit::EISO88591CharSet; |
|
536 case KCharacterSetIdentifierIso88592: |
|
537 return Versit::EISO88592CharSet; |
|
538 case KCharacterSetIdentifierIso88593: |
|
539 return Versit::EISO88593CharSet; |
|
540 case KCharacterSetIdentifierIso88594: |
|
541 return Versit::EISO88594CharSet; |
|
542 case KCharacterSetIdentifierIso88595: |
|
543 return Versit::EISO88595CharSet; |
|
544 case KCharacterSetIdentifierIso88597: |
|
545 return Versit::EISO88597CharSet; |
|
546 case KCharacterSetIdentifierIso88599: |
|
547 return Versit::EISO88599CharSet; |
|
548 case KCharacterSetIdentifierGb2312: |
|
549 return Versit::EGB231280CharSet; |
|
550 case KCharacterSetIdentifierGbk: |
|
551 return Versit::EGBKCharSet; |
|
552 case KCharacterSetIdentifierBig5: |
|
553 return Versit::EBIG5CharSet; |
|
554 case KCharacterSetIdentifierShiftJis: |
|
555 return Versit::EShiftJISCharSet; |
|
556 case KCharacterSetIdentifierJis: |
|
557 return Versit::EJISCharSet; |
|
558 case KCharacterSetIdentifierEucJpPacked: |
|
559 return Versit::EShiftJISCharSet; |
|
560 case KCharacterSetIdentifierIso2022Jp: |
|
561 case KCharacterSetIdentifierIso2022Jp1: |
|
562 return Versit::EShiftJISCharSet; |
|
563 |
|
564 default: |
|
565 case KCharacterSetIdentifierHz: |
|
566 case KCharacterSetIdentifierGb12345: |
|
567 case KCharacterSetIdentifierIso885910: |
|
568 case KCharacterSetIdentifierIso885913: |
|
569 case KCharacterSetIdentifierIso885914: |
|
570 case KCharacterSetIdentifierIso885915: |
|
571 case KCharacterSetIdentifierSms7Bit: |
|
572 return Versit::EUSAsciiCharSet; |
|
573 } |
|
574 } |
|
575 |
|
576 |
|
577 |
|
578 |