Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
opcua-asyncio
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
1
Merge Requests
1
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
Nikola Balog
opcua-asyncio
Commits
2e8439c8
Commit
2e8439c8
authored
Jul 15, 2015
by
Olivier R-D
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
attempt to fix utf stuff in python2 compatible way
parent
8cb031c1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
opcua/uatypes.py
opcua/uatypes.py
+5
-3
No files found.
opcua/uatypes.py
View file @
2e8439c8
...
...
@@ -150,8 +150,8 @@ def unpack_uatype_array(uatype, data):
def
pack_string
(
string
):
if
hasattr
(
string
,
"encode"
):
# attempt to convert to bytes anything than can
string
=
string
.
encode
()
if
type
(
string
)
is
unicode
:
string
=
string
.
encode
(
'utf-8'
)
length
=
len
(
string
)
if
length
==
0
:
return
struct
.
pack
(
"<i"
,
-
1
)
...
...
@@ -523,7 +523,9 @@ class LocalizedText(FrozenClass):
def
__init__
(
self
,
text
=
""
):
self
.
Encoding
=
0
self
.
Text
=
text
.
encode
()
self
.
Text
=
text
if
type
(
self
.
Text
)
is
unicode
:
self
.
Text
=
self
.
Text
.
encode
(
'utf-8'
)
if
self
.
Text
:
self
.
Encoding
|=
(
1
<<
1
)
self
.
Locale
=
b''
...
...
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