Dolda2000 GitWeb
/
wrw.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cbb90a8
)
Do Unicode conversion from bytestring more properly.
author
Fredrik Tolf
<fredrik@dolda2000.com>
Thu, 19 Sep 2013 01:15:26 +0000
(
03:15
+0200)
committer
Fredrik Tolf
<fredrik@dolda2000.com>
Thu, 19 Sep 2013 01:15:26 +0000
(
03:15
+0200)
wrw/sp/cons.py
patch
|
blob
|
blame
|
history
diff --git
a/wrw/sp/cons.py
b/wrw/sp/cons.py
index
4052dce
..
ff0d0af
100644
(file)
--- a/
wrw/sp/cons.py
+++ b/
wrw/sp/cons.py
@@
-1,3
+1,4
@@
+import sys
import xml.dom.minidom
class node(object):
@@
-39,9
+40,11
@@
class element(node):
return self.__todom__(doc).toxml()
class context(object):
+ charset = sys.getfilesystemencoding()
+
def __init__(self):
self.nodeconv = {}
- self.nodeconv[str] = lambda ob: text(ob,
"utf-8"
)
+ self.nodeconv[str] = lambda ob: text(ob,
self.charset
)
self.nodeconv[unicode] = text
self.nodeconv[int] = text
self.nodeconv[long] = text