Fixed unicode encoding in gen_cfile.py
authoretisserant
Thu, 28 Jun 2007 15:36:10 +0200
changeset 229 b24906340673
parent 228 c6e9fc22de5c
child 230 aa5ac69398bb
Fixed unicode encoding in gen_cfile.py
objdictgen/gen_cfile.py
--- a/objdictgen/gen_cfile.py	Wed Jun 27 08:35:22 2007 +0200
+++ b/objdictgen/gen_cfile.py	Thu Jun 28 15:36:10 2007 +0200
@@ -137,12 +137,11 @@
     strDeclareCallback = ""
     indexContents = {}
     indexCallbacks = {}
-    translate_characters = "".join([chr(i) for i in xrange(128)] + ["_" for i in xrange(128)])
     for index in listIndex:
         texts["index"] = index
         strIndex = ""
         entry_infos = Manager.GetEntryInfos(index)
-        texts["EntryName"] = entry_infos["name"].translate(translate_characters)
+        texts["EntryName"] = entry_infos["name"].encode('ascii','replace')
         values = Manager.GetCurrentEntry(index)
         callbacks = Manager.HasCurrentEntryCallbacks(index)
         if index in variablelist: