# -*- coding: utf-8 -*-
import string, sys, os, codecs, re, subprocess
class Charsets:
	Symbol = [
	['A','Α'], ['B','Β'], ['G','Γ'], ['D','Δ'], ['E','Ε'], ['Z','Ζ'], ['H','Η'],
	['Q','Θ'], ['I','Ι'], ['K','Κ'], ['L','Λ'], ['M','Μ'], ['N','Ν'], ['X','Ξ'],
	['O','Ο'], ['P','Π'], ['R','Ρ'], ['S','Σ'], ['T','Τ'], ['U','Υ'], ['F','Φ'],
	['C','Χ'], ['Y','Ψ'], ['W','Ω'], ['a','α'], ['b','β'], ['g','γ'], ['d','δ'],
	['e','ε'], ['z','ζ'], ['h','η'], ['q','θ'], ['i','ι'], ['k','κ'], ['l','λ'],
	['m','μ'], ['n','ν'], ['x','ξ'], ['o','ο'], ['p','π'], ['r','ρ'], ['V','ς'],
	['s','σ'], ['t','τ'], ['u','υ'], ['f','φ'], ['c','χ'], ['y','ψ'], ['w','ω'],
	['J','ϑ'], ['j','ϕ'], ['v','ϖ'], ['"','᾽'], ['#','῎'], ['$','῎'], ['%','῞'],
	["'",'᾽'], ['+','΅'], ['/','΄'], [':','῾'],	[';','῾'], ['\\','`'],['^','῞'],
	['`','ͺ']
	]
	BQTGrk = Symbol
	BQTHeb = [
	['"','‍ַ'], ['#','ֲ'], ['$','‍ֳ'], ['%','ֱ'], ["'",'‍ַ'], ['+','ּ'], ['/','ָ'],
	[';','ְ'], ['=','ּ'], ['C','ֻ'], ['F',' ‍ׂ'], ['I','ִ'], ['K','ך'], ['M','ם'],
	['N','ן'], ['P','ף'], ['S',' ‍ׂ'], ['U','ץ'], ['V',' ‍ׁ'], ['[','ֵ'], ['\\',' ‍ׇ'],
	[']','ֶ'], ['_','ְ'], ['a','א'], ['b','ב'], ['c','ֻ'], ['d','ד'], ['e','ע'],
	['f',' ‍ֹ'], ['g','נ'], ['h','ה'], ['i',' ‍ׅ'], ['j','ט'], ['k','כ'], ['l','ל'],
	['m','מ'], ['n','נ'], ['o','ס'], ['p','פ'], ['q','ק'], ['r','ר'], ['s','ש'],
	['t','ת'], ['u','צ'], ['v','ש'], ['w','ו'], ['x','ח'], ['y','י'], ['z','ז'],
	['{','ֵ'], ['}','ֶ']
	]

HebrewFonts = [Charsets.BQTHeb]

#перевод текста к правильному набору символов. Нужно поскольку некоторые
#модули используют для отображения некоторых языков (греческого, например)
#шрифты с расположением символов, не соответствующим ASCII
#перевод текста к нужному набору символов
def RecodeToCharset(Text, Charset):
	NewText = ''
	#если испльзуется еврейский шрифт, еще надо поменять порядок символов
	#в строке, потому-чо в utf-8 иврит пишется справа налево
	if Charset in HebrewFonts:
		Text = Text[::-1]
	print Text
	for i in xrange(0, len(Text)):
		Found = False
		for Pair in Charset:
			if Pair[0]==Text[i]:
				NewText = NewText + Pair[1]
				Found = True
		if not Found:
			NewText = NewText + Text[i]
	return NewText

Text='l[a'
print RecodeToCharset(Text, Charsets.BQTHeb)

