This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2012年10月28日 04:06 by reingart, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| pyunicode_fromformat_utf8.patch | reingart, 2012年10月28日 04:06 | PyUnicode_FromFormatV patch to use UTF-8 | review | |
| Messages (4) | |||
|---|---|---|---|
| msg173996 - (view) | Author: Mariano Reingart (reingart) | Date: 2012年10月28日 04:06 | |
Working in an internationalization proposal <http://python.org.ar/pyar/TracebackInternationalizationProposal> I've stopped at #9769 where multi byte encodings (like utf-8) is not supported by PyUnicode_FromFormatV() Beside my proposal, I think utf-8 should be supported for consistency with the other unicode functions, like PyUnicode_FromString() or even unicode_fromformat_arg() Attached is a patch that: - enhanced the iterator to detect multibyte sequences, with sanity checks about start & continuation bytes - replaced unicode_write_cstr with PyUnicode_DecodeUTF8Stateful - tests Hope it helps, this is my first patch for cpython and my C skills are a bit rusty, so excuse me if there is any newbie glitch |
|||
| msg174022 - (view) | Author: Chris Jerdonek (chris.jerdonek) * (Python committer) | Date: 2012年10月28日 10:02 | |
Shouldn't this patch be attached to the referenced issue 9769 instead of creating a new issue? Even the issue title is nearly the same: 9769: PyUnicode_FromFormatV() doesn't handle non-ascii text correctly 16343: PyUnicode_FromFormatV() doesn't support utf-8 text |
|||
| msg174072 - (view) | Author: Mariano Reingart (reingart) | Date: 2012年10月28日 20:01 | |
I thought #9769 was closed (in fact, that patch was already applied). Now, PyUnicode_FromFormatV() doesn't handle non-ascii text at all. Maybe I misread the part telling to open a new issue in the comments, sorry for that. |
|||
| msg174073 - (view) | Author: Chris Jerdonek (chris.jerdonek) * (Python committer) | Date: 2012年10月28日 20:14 | |
Issue 9769 is still open. It looks like there was some disagreement in the comments between Alexander and Victor as to whether a new issue should be created (since Victor had a different idea when first opening the issue), but it looks like Victor deferred to Alexander in his final comment. I will close this issue as a duplicate, and if you could repost your patch on the other issue, that would be great. The discussion there is relevant to your patch. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:37 | admin | set | github: 60547 |
| 2012年10月28日 20:14:48 | chris.jerdonek | set | status: open -> closed superseder: PyUnicode_FromFormatV() doesn't handle non-ascii text correctly messages: + msg174073 resolution: duplicate stage: resolved |
| 2012年10月28日 20:01:20 | reingart | set | messages: + msg174072 |
| 2012年10月28日 10:02:16 | chris.jerdonek | set | nosy:
+ chris.jerdonek messages: + msg174022 |
| 2012年10月28日 04:42:27 | r.david.murray | set | nosy:
+ vstinner |
| 2012年10月28日 04:06:11 | reingart | create | |