Bugs item #3077003, was opened at 2010-09-28 01:39
Message generated for change (Tracker Item Submitted) made by kthomases
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=114534&aid=3077003&group_id=14534
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Ken Thomases (kthomases)
Assigned to: Nobody/Anonymous (nobody)
Summary: Misuse of strcmp() in -[OC_PythonString __realObject__]
Initial Comment:
Relatively recently, -[OC_PythonString __realObject__] was improved to try to use an encoding which matches the Python default encoding. Unfortunately, it was done incorrectly. It uses strcmp() as though it were a strequals() function, but the return value of strcmp() has the opposite logical sense. It's 0 when the strings are equal and non-zero when they differ. The result was that it uses UTF-8 when the Python encoding is "ascii" and ASCII otherwise. (That's actually not a terrible result, since on Mac OS X UTF-8 is almost always the correct encoding to use, even though it's not Python's default encoding.)
Anyway, I'm attaching a patch to correct the logic.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=114534&aid=3077003&group_id=14534
|