Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit e174284

Browse filesBrowse files
committed
Use 'latin_1' encoding instead of ascii
1 parent 92bccd2 commit e174284
Copy full SHA for e174284

File tree

Expand file treeCollapse file tree

1 file changed

+2
-2
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-2
lines changed

‎src/_png.cpp

Copy file name to clipboardExpand all lines: src/_png.cpp
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ static PyObject *Py_write_png(PyObject *self, PyObject *args, PyObject *kwds)
293293
text[meta_pos].compression = PNG_TEXT_COMPRESSION_NONE;
294294
#if PY3K
295295
if (PyUnicode_Check(meta_key)) {
296-
PyObject *temp_key = PyUnicode_AsEncodedString(meta_key, "ASCII", "strict");
296+
PyObject *temp_key = PyUnicode_AsEncodedString(meta_key, "latin_1", "strict");
297297
if (temp_key != NULL) {
298298
text[meta_pos].key = PyBytes_AsString(temp_key);
299299
}
@@ -303,7 +303,7 @@ static PyObject *Py_write_png(PyObject *self, PyObject *args, PyObject *kwds)
303303
text[meta_pos].key = NULL; // Silently drops entry
304304
}
305305
if (PyUnicode_Check(meta_val)) {
306-
PyObject *temp_val = PyUnicode_AsEncodedString(meta_val, "ASCII", "strict");
306+
PyObject *temp_val = PyUnicode_AsEncodedString(meta_val, "latin_1", "strict");
307307
if (temp_val != NULL) {
308308
text[meta_pos].text = PyBytes_AsString(temp_val);
309309
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.