mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-02-21 10:01:54 +00:00
bencode.py: reencode as UTF-8
This commit is contained in:
parent
4423bc7510
commit
57373c9889
@ -1,4 +1,5 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
"""
|
"""
|
||||||
A library for streaming and unstreaming of simple objects, designed
|
A library for streaming and unstreaming of simple objects, designed
|
||||||
@ -41,7 +42,7 @@ bencode('spam') == '4:spam'
|
|||||||
Unicode string objects are indicated with an initial u, a base 10
|
Unicode string objects are indicated with an initial u, a base 10
|
||||||
length-prefix, and the remaining bytes in utf-8 encoding.
|
length-prefix, and the remaining bytes in utf-8 encoding.
|
||||||
|
|
||||||
bencode(u'\u00bfHabla espa\u00f1ol?') == 'ËHabla espaÐol?'
|
bencode(u'\u00bfHabla espa\u00f1ol?') == '¿Habla español?'
|
||||||
|
|
||||||
Nulls are indicated by a single 'n'.
|
Nulls are indicated by a single 'n'.
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user