commit-gnue
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnue] r8348 - trunk/gnue-designer/src/base


From: jcater
Subject: [gnue] r8348 - trunk/gnue-designer/src/base
Date: Mon, 3 Apr 2006 18:54:54 -0500 (CDT)

Author: jcater
Date: 2006-04-03 18:54:54 -0500 (Mon, 03 Apr 2006)
New Revision: 8348

Modified:
   trunk/gnue-designer/src/base/Document.py
Log:
Since SAX won't let us access the encoding used for a document, but rather 
converts to unicode, we now always write out XML in UTF-8 encoding.

issue41 testing


Modified: trunk/gnue-designer/src/base/Document.py
===================================================================
--- trunk/gnue-designer/src/base/Document.py    2006-04-03 22:10:04 UTC (rev 
8347)
+++ trunk/gnue-designer/src/base/Document.py    2006-04-03 23:54:54 UTC (rev 
8348)
@@ -212,8 +212,7 @@
 
         fileHandle = open(location,'w')
 
-        fileHandle.write('<?xml version="1.0" encoding="%s"?>\n\n' % \
-               gConfig('textEncoding'))
+        fileHandle.write('<?xml version="1.0" encoding="UTF-8"?>\n\n')
 
         for comment in self.rootObject._rootComments:
             if comment.find(TITLE) > 0:
@@ -221,14 +220,14 @@
 
         # Place a timestamp in the XML as a comment
         # TODO: Replace with Dublin Core?
-        fileHandle.write('<!--  %s (%s)\n%s      Saved on: %s  -->\n\n' \
+        fileHandle.write(('<!--  %s (%s)\n%s      Saved on: %s  -->\n\n' \
            % (TITLE, VERSION, (len(self.wizardName) and ("      Created by " + 
self.wizardName + "\n") or ""),\
-              time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(time.time()))))
+              time.strftime("%Y-%m-%d %H:%M:%S", 
time.localtime(time.time())))).encode('UTF-8'))
 
-        fileHandle.write(''.join(["<!--%s-->\n\n" % 
comment.encode(gConfig('textEncoding')) \
+        fileHandle.write(''.join(["<!--%s-->\n\n" % comment.encode('UTF-8') \
                          for comment in self.rootObject._rootComments]))
 
-        
fileHandle.write(self.rootObject.dumpXML(treeDump=True).encode(gConfig('textEncoding')))
+        
fileHandle.write(self.rootObject.dumpXML(treeDump=True).encode('UTF-8'))
         fileHandle.close()
 
         self.app.mru.addLocation(location)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]