dabo Commit
Revision 4893
Date: 2008-12-27 15:29:12 -0800 (Sat, 27 Dec 2008)
Author: Ed
Trac: http://trac.dabodev.com/changeset/4893

Changed:
U   trunk/dabo/lib/xmltodict.py

Log:
Added code to normalize all the variations for the names of 'utf-n' encodings.


Diff:
Modified: trunk/dabo/lib/xmltodict.py
===================================================================
--- trunk/dabo/lib/xmltodict.py 2008-12-27 19:01:01 UTC (rev 4892)
+++ trunk/dabo/lib/xmltodict.py 2008-12-27 23:29:12 UTC (rev 4893)
@@ -23,7 +23,13 @@
                default_encoding = locale.getdefaultlocale()[1]
                if default_encoding is None:
                        default_encoding = dabo.defaultEncoding
-               
+# Normalize the names, as xml.sax running on Gtk will complain for some 
variations
+deLow = default_encoding.lower()
+if deLow in ("utf8", "utf-8"):
+       default_encoding = "utf-8"
+if deLow in ("utf16", "utf-16"):
+       default_encoding = "utf-16"
+
 # Python seems to need to compile code with \n linesep:
 code_linesep = "\n"
 eol = os.linesep




_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: 
http://leafe.com/archives/byMID/[email protected]

Reply via email to