Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
X
xml_marshaller
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
xml_marshaller
Commits
b92fe755
Commit
b92fe755
authored
Oct 28, 2010
by
Nicolas Delaby
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Return always string as str and unicode as unicode.
codec used for encoding is utf-8.
parent
ce4b76b9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
src/xml_marshaller/xml_marshaller.py
src/xml_marshaller/xml_marshaller.py
+8
-4
No files found.
src/xml_marshaller/xml_marshaller.py
View file @
b92fe755
...
...
@@ -440,14 +440,18 @@ class Unmarshaller(ElementTreeContentHandler):
def
um_end_string
(
self
,
name
):
ds
=
self
.
data_stack
# might need to convert unicode string to byte string
ds
[
-
1
]
=
unescape
(
''
.
join
(
ds
[
-
1
]))
value
=
unescape
(
''
.
join
(
ds
[
-
1
]))
if
isinstance
(
value
,
unicode
):
value
=
value
.
encode
(
'utf-8'
)
ds
[
-
1
]
=
value
self
.
accumulating_chars
=
0
def
um_end_unicode
(
self
,
name
):
ds
=
self
.
data_stack
# might need to convert unicode string to byte string
ds
[
-
1
]
=
unescape
(
''
.
join
(
ds
[
-
1
]))
value
=
unescape
(
''
.
join
(
ds
[
-
1
]))
if
not
isinstance
(
value
,
unicode
):
value
=
value
.
decode
(
'utf-8'
)
ds
[
-
1
]
=
value
self
.
accumulating_chars
=
0
def
um_end_int
(
self
,
name
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment