Mercurial > hg > orthanc
comparison Resources/EncodingTests.py @ 1347:60cc0ee61edb
fix issue #32
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 21 Apr 2015 17:43:05 +0200 |
parents | a66224eec125 |
children | 423d3b692bb9 |
comparison
equal
deleted
inserted
replaced
1346:911a1ad5ebe8 | 1347:60cc0ee61edb |
---|---|
10 'ISO-8859-2' : 'Latin2', | 10 'ISO-8859-2' : 'Latin2', |
11 'ISO-8859-3' : 'Latin3', | 11 'ISO-8859-3' : 'Latin3', |
12 'ISO-8859-4' : 'Latin4', | 12 'ISO-8859-4' : 'Latin4', |
13 'ISO-8859-9' : 'Latin5', | 13 'ISO-8859-9' : 'Latin5', |
14 'ISO-8859-5' : 'Cyrillic', | 14 'ISO-8859-5' : 'Cyrillic', |
15 'WINDOWS-1251' : 'Windows1251', | |
15 'ISO-8859-6' : 'Arabic', | 16 'ISO-8859-6' : 'Arabic', |
16 'ISO-8859-7' : 'Greek', | 17 'ISO-8859-7' : 'Greek', |
17 'ISO-8859-8' : 'Hebrew', | 18 'ISO-8859-8' : 'Hebrew', |
18 'TIS-620' : 'Thai', | 19 'TIS-620' : 'Thai', |
19 'SHIFT-JIS' : 'Japanese', | 20 'SHIFT-JIS' : 'Japanese', |
47 # https://en.wikipedia.org/wiki/GB_18030#Technical_details (*) | 48 # https://en.wikipedia.org/wiki/GB_18030#Technical_details (*) |
48 l.append('::Orthanc::Encoding_Chinese') | 49 l.append('::Orthanc::Encoding_Chinese') |
49 expected.append(ToArray('Þßàáâã')) | 50 expected.append(ToArray('Þßàáâã')) |
50 encoded.append('"\\x81\\x30\\x89\\x37\\x81\\x30\\x89\\x38\\xA8\\xA4\\xA8\\xA2\\x81\\x30\\x89\\x39\\x81\\x30\\x8A\\x30"') | 51 encoded.append('"\\x81\\x30\\x89\\x37\\x81\\x30\\x89\\x38\\xA8\\xA4\\xA8\\xA2\\x81\\x30\\x89\\x39\\x81\\x30\\x8A\\x30"') |
51 | 52 |
53 # Issue 32 | |
54 # "encoded" is the copy/paste from "dcm2xml +Ca cyrillic Issue32.dcm" | |
55 l.append('::Orthanc::Encoding_Windows1251') | |
56 encoded.append('"\\xd0\\xe5\\xed\\xf2\\xe3\\xe5\\xed\\xee\\xe3\\xf0\\xe0\\xf4\\xe8\\xff"') | |
57 expected.append(ToArray('Рентгенография')) | |
58 l.append('::Orthanc::Encoding_Windows1251') | |
59 encoded.append('"\\xD2\\xE0\\xE7"') | |
60 expected.append(ToArray('Таз')) | |
61 l.append('::Orthanc::Encoding_Windows1251') | |
62 encoded.append('"\\xcf\\xf0\\xff\\xec\\xe0\\xff"') | |
63 expected.append(ToArray('Прямая')) | |
64 | |
52 | 65 |
53 if True: | 66 if True: |
54 print 'static const unsigned int testEncodingsCount = %d;' % len(l) | 67 print 'static const unsigned int testEncodingsCount = %d;' % len(l) |
55 print 'static const ::Orthanc::Encoding testEncodings[] = {\n %s\n};' % (',\n '.join(l)) | 68 print 'static const ::Orthanc::Encoding testEncodings[] = {\n %s\n};' % (',\n '.join(l)) |
56 print 'static const char *testEncodingsEncoded[%d] = {\n %s\n};' % (len(l), ',\n '.join(encoded)) | 69 print 'static const char *testEncodingsEncoded[%d] = {\n %s\n};' % (len(l), ',\n '.join(encoded)) |