aboutsummaryrefslogtreecommitdiff
path: root/odfrecode/recoders/armscii.py
blob: 9098ba653613440864d2c71b0c1dd20c6fae6a6c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# vim:encoding=utf-8:fileencoding=utf-8
#
# odfrecode
#
# (c) 2007,2008 Guido G√ľnther <agx@sigxcpu.org>
#
#   This program is free software; you can redistribute it and/or modify
#   it under the terms of the GNU General Public License as published by
#   the Free Software Foundation; either version 2 of the License, or
#   (at your option) any later version.
#
#   This program is distributed in the hope that it will be useful,
#   but WITHOUT ANY WARRANTY; without even the implied warranty of
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#   GNU General Public License for more details.
#
#   You should have received a copy of the GNU General Public License
#   along with this program; if not, write to the Free Software
#   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#
# the mapping table is based on a utf16 encoded table of a vbscript that is:
# (c) 2003 VAHE GEVORGYAN, UNDER GPL LICENSE

import recoder

class Armscii8(recoder.Recoder):
    """this class maps armscii8 to unicode"""

    encoding = 'armscii8'
    dst_encoding = 'utf-16-be'

    character_table = {
        u'\xd8': '\x05\x44',
        u'\xd9': '\x05\x74',
        u'\xd6': '\x05\x43',
        u'\xd7': '\x05\x73',
        u'\xd4': '\x05\x42',
        u'\xd5': '\x05\x72',
        u'\xd2': '\x05\x41',
        u'\xd3': '\x05\x71',
        u'\xda': '\x05\x45',
        u'\xdb': '\x05\x75',
        u'\xa4': '\x00\x29',
        u'\xa5': '\x00\x28',
        u'\xa6': '\x00\xbb',
        u'\xa7': '\x00\xab',
        u'\xdc': '\x05\x46',
        u'\xc7': '\x05\x6b',
        u'\xc6': '\x05\x3b',
        u'\xc3': '\x05\x69',
        u'\xc2': '\x05\x39',
        u'\xc5': '\x05\x6a',
        u'\xc4': '\x05\x3a',
        u'\xbf': '\x05\x67',
        u'\xbe': '\x05\x37',
        u'\xc1': '\x05\x68',
        u'\xc0': '\x05\x38',
        u'\xfc': '\x05\x56',
        u'\xfd': '\x05\x86',
        u'\xfa': '\x05\x55',
        u'\xfb': '\x05\x85',
        u'\xfe': '\x05\x5a',
        u'\xf5': '\x05\x82',
        u'\xf4': '\x05\x52',
        u'\xf7': '\x05\x83',
        u'\xf6': '\x05\x53',
        u'\xf1': '\x05\x80',
        u'\xf0': '\x05\x50',
        u'\xf3': '\x05\x81',
        u'\xf2': '\x05\x51',
        u'\xf9': '\x05\x84',
        u'\xf8': '\x05\x54',
        u'\xb3': '\x05\x61',
        u'\xb2': '\x05\x31',
        u'\xb1': '\x05\x5e',
        u'\xb0': '\x05\x5b',
        u'\xaf': '\x05\x5c',
        u'\xae': '\x20\x26',
        u'\xad': '\x05\x8a',
        u'\xac': '\x00\x2d',
        u'\xab': '\x00\x2c',
        u'\xaa': '\x05\x5d',
        u'\xb6': '\x05\x33',
        u'\xb7': '\x05\x63',
        u'\xb4': '\x05\x32',
        u'\xb5': '\x05\x62',
        u'\xba': '\x05\x35',
        u'\xbb': '\x05\x65',
        u'\xb8': '\x05\x34',
        u'\xb9': '\x05\x64',
        u'\xbc': '\x05\x36',
        u'\xbd': '\x05\x66',
        u'\xa8': '\x05\x87',
        u'\xa9': '\x00\x2e',
        u'\xe5': '\x05\x7a',
        u'\xe4': '\x05\x4a',
        u'\xe3': '\x05\x79',
        u'\xe2': '\x05\x49',
        u'\xe1': '\x05\x78',
        u'\xe0': '\x05\x48',
        u'\xdf': '\x05\x77',
        u'\xde': '\x05\x47',
        u'\xdd': '\x05\x76',
        u'\xa3': '\x05\x89',
        u'\xee': '\x05\x4f',
        u'\xef': '\x05\x7f',
        u'\xea': '\x05\x4d',
        u'\xeb': '\x05\x7d',
        u'\xec': '\x05\x4e',
        u'\xed': '\x05\x7e',
        u'\xe6': '\x05\x4b',
        u'\xe7': '\x05\x7b',
        u'\xe8': '\x05\x4c',
        u'\xe9': '\x05\x7c',
        u'\xc9': '\x05\x6c',
        u'\xc8': '\x05\x3c',
        u'\xcb': '\x05\x6d',
        u'\xca': '\x05\x3d',
        u'\xcd': '\x05\x6e',
        u'\xcc': '\x05\x3e',
        u'\xcf': '\x05\x6f',
        u'\xce': '\x05\x3f',
        u'\xd1': '\x05\x70',
        u'\xd0': '\x05\x40',
       }