"=" : u'\u0304', # macron
"u" : u'\u0306', # breve
"." : u'\u0307', # dot above
- "\"": u'\u0308', # diaresis
+ "\"": u'\u0308', # diaeresis
"r" : u'\u030a', # ring above
"H" : u'\u030b', # double acute
"v" : u'\u030c', # caron
return ''
a = accent_map.get(type)
if a:
- return unicodedata.normalize("NFKC", "%s%s" % (char, a))
+ return unicodedata.normalize("NFC", "%s%s" % (char, a))
return ''
# because we never use u'xxx' for string literals, but 'xxx'.
# Therefore we may have to try two times to normalize the data.
try:
- document.body[i] = unicodedata.normalize("NFKD", document.body[i])
+ document.body[i] = unicodedata.normalize("NFD", document.body[i])
except TypeError:
- document.body[i] = unicodedata.normalize("NFKD", unicode(document.body[i], 'utf-8'))
+ document.body[i] = unicodedata.normalize("NFD", unicode(document.body[i], 'utf-8'))
# Replace accented characters with InsetLaTeXAccent
# Do not convert characters that can be represented in the chosen
accented_char = inverse_accented_map[accented_char]
accent = document.body[i][j]
try:
- dummy = unicodedata.normalize("NFKC", accented_char + accent).encode(encoding_stack[-1])
+ dummy = unicodedata.normalize("NFC", accented_char + accent).encode(encoding_stack[-1])
except UnicodeEncodeError:
# Insert the rest of the line as new line
if j < len(document.body[i]) - 1:
break
# Normalize to "Normal form C" (NFC, pre-composed characters) again
for i in range(numberoflines):
- document.body[i] = unicodedata.normalize("NFKC", document.body[i])
+ document.body[i] = unicodedata.normalize("NFC", document.body[i])
def normalize_font_whitespace_259(document):
spec_chars = {}
for line in fp.readlines():
if line[0] != '#':
- line=line.replace(' "',' ') # remove all qoutation marks with spaces before
- line=line.replace('" ',' ') # remove all qoutation marks with spaces after
- line=line.replace(r'\"','"') # replace \" by " (for characters with diaresis)
+ line=line.replace(' "',' ') # remove all quotation marks with spaces before
+ line=line.replace('" ',' ') # remove all quotation marks with spaces after
+ line=line.replace(r'\"','"') # replace \" by " (for characters with diaeresis)
try:
# flag1 and flag2 are preamble & flags
# currently NOT implemented