diff options
| author | Flaper Fesp <flaper87@gmail.com> | 2013-01-24 13:33:45 +0100 |
|---|---|---|
| committer | Flaper Fesp <flaper87@gmail.com> | 2013-02-25 17:52:07 +0100 |
| commit | bd5dad97585208ea5e86d636f3dc3b669e361a41 (patch) | |
| tree | fb58c80f702dea421f3b712221875a6924826cd2 /openstack/common/plugin | |
| parent | 15377750465b6eb261d2354988b9c90f1f3c1d29 (diff) | |
| download | oslo-bd5dad97585208ea5e86d636f3dc3b669e361a41.tar.gz oslo-bd5dad97585208ea5e86d636f3dc3b669e361a41.tar.xz oslo-bd5dad97585208ea5e86d636f3dc3b669e361a41.zip | |
Decode / Encode string utils for openstack
Currently some clients lack of non-ASCII characters support. This patch
introduces 2 functions (strutils.py) that will help clients and servers
to "safely" encode and decode strings.
About the ensure_(str|unicode) functions:
They both try to use first the encoding used in stdin (or python's
default encoding if that's None) and fallback to utf-8 if those
encodings fail to decode a given text.
Neither of them will try to encode / decode non-basestring objects
and will raise a TypeError if one is passed.
Use case:
This is currently being used in glanceclient. I5c3ea93a716edfe284d19f6291d4e36028f91eb2
Needed For:
* Bug 1061156
* Bug 1130572
Change-Id: I78960dfdb6159fd600a6f5e5551ab5d5a3366ab5
Diffstat (limited to 'openstack/common/plugin')
0 files changed, 0 insertions, 0 deletions
