Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

dump to version 0.2.0

  • Loading branch information...
commit 38b177901dd609513d669aca8101516119be42a6 1 parent 5bfc74d
@rfk authored
Showing with 22 additions and 2 deletions.
  1. +1 −1  ChangeLog.txt
  2. +10 −0 README.rst
  3. +11 −1 tnetstring/__init__.py
View
2  ChangeLog.txt
@@ -1,5 +1,5 @@
-v0.1.1:
+v0.2.0:
* Easy loading of unicode strings. If you pass an optional "encoding"
argument to load/loads/pop then it will return unicode string objects
View
10 README.rst
@@ -36,3 +36,13 @@ at once, there's no efficiency gain from using the file-based versions of these
functions. They're only here so you can use load() to read precisely one
item from a file or socket without consuming any extra data.
+By default tnetstrings work only with byte strings, not unicode. If you want
+unicode strings then pass an optional encoding to the various functions,
+like so::
+
+ >>> print repr(tnetstring.loads("2:\xce\xb1,"))
+ '\xce\xb1'
+ >>>
+ >>> print repr(tnetstring.loads("2:\xce\xb1,","utf8"))
+ u'\u03b1'
+
View
12 tnetstring/__init__.py
@@ -36,10 +36,20 @@
functions. They're only here so you can use load() to read precisely one
item from a file or socket without consuming any extra data.
+By default tnetstrings work only with byte strings, not unicode. If you want
+unicode strings then pass an optional encoding to the various functions,
+like so::
+
+ >>> print repr(tnetstring.loads("2:\\xce\\xb1,"))
+ '\\xce\\xb1'
+ >>>
+ >>> print repr(tnetstring.loads("2:\\xce\\xb1,","utf8"))
+ u'\u03b1'
+
"""
__ver_major__ = 0
-__ver_minor__ = 1
+__ver_minor__ = 2
__ver_patch__ = 0
__ver_sub__ = ""
__version__ = "%d.%d.%d%s" % (__ver_major__,__ver_minor__,__ver_patch__,__ver_sub__)
Please sign in to comment.
Something went wrong with that request. Please try again.