aboutsummaryrefslogtreecommitdiff
path: root/odfrecode/recoders/greek.py
blob: 7610338582f7a344b58fe58682b3cf05347bdd53 (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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
# vim:encoding=utf-8:fileencoding=utf-8
#
# odfrecode
#
# (c) 2007,2009 Guido G√ľnther <agx@sigxcpu.org>
# (c) 2007 Torsten Werner <twerner@debian.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
#

import recoder

class Greek(recoder.Recoder):
    """
    this class maps greek characters from 0x80-0xff to unicode
    the mapping table is based on code from VeraWeb's madlan converter
    """

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

    character_table = {
        u'\x82': '\x20\x1a',
        u'\x83': '\x01\x92',
        u'\x84': '\x20\x1e',
        u'\x85': '\x20\x26',
        u'\x86': '\x20\x20',
        u'\x87': '\x20\x21',
        u'\x88': '\x02\xc6',
        u'\x89': '\x20\x30',
        u'\x8a': '\x01\x60',
        u'\x8b': '\x20\x39',
        u'\x8c': '\x01\x52',
        u'\x91': '\x20\x18',
        u'\x92': '\x20\x19',
        u'\x93': '\x20\x1c',
        u'\x94': '\x20\x10',
        u'\x95': '\x20\x22',
        u'\x96': '\x20\x13',
        u'\x97': '\x20\x14',
        u'\x98': '\x02\xdc',
        u'\x99': '\x21\x22',
        u'\x9a': '\x01\x61',
        u'\x9b': '\x20\x3a',
        u'\x9c': '\x01\x53',
        u'\x9f': '\x01\x78',
        u'\xa1': '\x03\x85',
        u'\xa2': '\x03\x86',
        u'\xa3': '\x00\xa3',
        u'\xa4': '\x00\xa4',
        u'\xa5': '\x00\xa5',
        u'\xa6': '\x00\xa6',
        u'\xa7': '\x00\xa7',
        u'\xa8': '\x00\xa8',
        u'\xa9': '\x00\xa9',
        u'\xaa': '\x00\xaa',
        u'\xab': '\x00\xab',
        u'\xac': '\x00\xac',
        u'\xad': '\x00\xad',
        u'\xae': '\x00\xae',
        u'\xaf': '\x00\xaf',
        u'\xb0': '\x00\xb0',
        u'\xb1': '\x00\xb1',
        u'\xb2': '\x00\xb2',
        u'\xb3': '\x00\xb3',
        u'\xb4': '\x00\xb4',
        u'\xb5': '\x00\xb5',
        u'\xb6': '\x00\xb6',
        u'\xb7': '\x00\xb7',
        u'\xb8': '\x03\x88',
        u'\xb9': '\x03\x89',
        u'\xba': '\x03\x8a',
        u'\xbb': '\x00\xbb',
        u'\xbc': '\x03\x8c',
        u'\xbd': '\x00\xbd',
        u'\xbe': '\x03\x8e',
        u'\xbf': '\x03\x8f',
        u'\xc0': '\x03\x90',
        u'\xc1': '\x03\x91',
        u'\xc2': '\x03\x92',
        u'\xc3': '\x03\x93',
        u'\xc4': '\x03\x94',
        u'\xc5': '\x03\x95',
        u'\xc6': '\x03\x96',
        u'\xc7': '\x03\x97',
        u'\xc8': '\x03\x98',
        u'\xc9': '\x03\x99',
        u'\xca': '\x03\x9a',
        u'\xcb': '\x03\x9b',
        u'\xcc': '\x03\x9c',
        u'\xcd': '\x03\x9d',
        u'\xce': '\x03\x9e',
        u'\xcf': '\x03\x9f',
        u'\xd0': '\x03\xa0',
        u'\xd1': '\x03\xa1',
        u'\xd2': '\x03\xda',
        u'\xd3': '\x03\xa3',
        u'\xd4': '\x03\xa4',
        u'\xd5': '\x03\xa5',
        u'\xd6': '\x03\xa6',
        u'\xd7': '\x03\xa7',
        u'\xd8': '\x03\xa8',
        u'\xd9': '\x03\xa9',
        u'\xda': '\x03\xaa',
        u'\xdb': '\x03\xab',
        u'\xdc': '\x03\xac',
        u'\xdd': '\x03\xad',
        u'\xde': '\x03\xae',
        u'\xdf': '\x03\xaf',
        u'\xe0': '\x03\xb0',
        u'\xe1': '\x03\xb1',
        u'\xe2': '\x03\xb2',
        u'\xe3': '\x03\xb3',
        u'\xe4': '\x03\xb4',
        u'\xe5': '\x03\xb5',
        u'\xe6': '\x03\xb6',
        u'\xe7': '\x03\xb7',
        u'\xe8': '\x03\xb8',
        u'\xe9': '\x03\xb9',
        u'\xea': '\x03\xba',
        u'\xeb': '\x03\xbb',
        u'\xec': '\x03\xbc',
        u'\xed': '\x03\xbd',
        u'\xee': '\x03\xbe',
        u'\xef': '\x03\xbf',
        u'\xf0': '\x03\xc0',
        u'\xf1': '\x03\xc1',
        u'\xf2': '\x03\xc2',
        u'\xf3': '\x03\xc3',
        u'\xf4': '\x03\xc4',
        u'\xf5': '\x03\xc5',
        u'\xf6': '\x03\xc6',
        u'\xf7': '\x03\xc7',
        u'\xf8': '\x03\xc8',
        u'\xf9': '\x03\xc9',
        u'\xfa': '\x03\xca',
        u'\xfb': '\x03\xcb',
        u'\xfc': '\x03\xcc',
        u'\xfd': '\x03\xce',
        u'\xfe': '\x03\xce',
	}