s/latin-1/latin1/g

This commit is contained in:
Behdad Esfahbod 2013-11-28 06:46:59 -05:00
parent 5e1e8f6890
commit c076261598
4 changed files with 7 additions and 7 deletions

View File

@ -676,11 +676,11 @@ class SimpleConverter:
class Latin1Converter(SimpleConverter):
def xmlWrite(self, xmlWriter, name, value, progress):
# Store as UTF-8
value = value.decode("latin-1").encode("utf-8")
value = value.decode("latin1").encode("utf-8")
xmlWriter.simpletag(name, value=value)
xmlWriter.newline()
def xmlRead(self, name, attrs, content, parent):
return attrs["value"].decode("utf-8").encode("latin-1")
return attrs["value"].decode("utf-8").encode("latin1")
def parseNum(s):

View File

@ -39,7 +39,7 @@ if str == bytes:
if isinstance(self, bytes):
return self
else:
return self.encode('latin-1')
return self.encode('latin1')
def tostr(s, encoding='ascii'):
if not isinstance(s, str):

View File

@ -52,8 +52,8 @@ class XMLWriter:
"""Writes a bytes() sequence into the XML, escaping
non-ASCII bytes. When this is read in xmlReader,
the original bytes can be recovered by encoding to
'latin-1'."""
self._writeraw(escape8bit(data.decode('latin-1')))
'latin1'."""
self._writeraw(escape8bit(data.decode('latin1')))
def write_noindent(self, string):
"""Writes text without indentation."""

View File

@ -269,8 +269,8 @@ def guessFileType(fileName):
elif head == "wOFF":
return "WOFF"
elif head.lower() == "<?xm":
# Use 'latin-1' because that can't fail.
header = tostr(header, 'latin-1')
# Use 'latin1' because that can't fail.
header = tostr(header, 'latin1')
if opentypeheaderRE.search(header):
return "OTX"
else: