File tree Expand file tree Collapse file tree 3 files changed +7
-4
lines changed Expand file tree Collapse file tree 3 files changed +7
-4
lines changed Original file line number Diff line number Diff line change 9
9
* add some libvips 8.7 tests
10
10
* move to pytest [kleis]
11
11
* better handling of many-byte values in py3 new_from_memory [MatthiasKohl]
12
+ * better handling of utf-8 i18n text [felixbuenemann]
12
13
13
14
## Version 2.1.2 (1 March 2018)
14
15
Original file line number Diff line number Diff line change @@ -22,7 +22,6 @@ def _to_bytes(x):
22
22
call this on strings you pass to libvips.
23
23
24
24
"""
25
-
26
25
if isinstance (x , text_type ):
27
26
x = x .encode ()
28
27
return x
@@ -35,8 +34,11 @@ def _to_string(x):
35
34
string. You must call this on text strings you get back from libvips.
36
35
37
36
"""
38
- if _is_PY3 and isinstance (x , bytes ):
39
- x = x .decode ('utf-8' )
37
+ if isinstance (x , bytes ):
38
+ if _is_PY3 :
39
+ x = x .decode ('utf-8' )
40
+ else :
41
+ x = unicode (x , 'utf-8' )
40
42
return x
41
43
42
44
Original file line number Diff line number Diff line change @@ -292,7 +292,7 @@ def generate_docstring(operation_name):
292
292
result += ")\n "
293
293
294
294
def argstr (name ):
295
- return (' {0} ({1}): {2}\n ' .
295
+ return (u ' {0} ({1}): {2}\n ' .
296
296
format (name ,
297
297
GValue .gtype_to_python (op .get_typeof (name )),
298
298
op .get_blurb (name )))
You can’t perform that action at this time.
0 commit comments