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.

Author vstinner
Recipients RaminNietzsche, SilentGhost, ezio.melotti, lemburg, ned.deily, ronaldoussoren, vstinner
Date 2019-06-07.16:08:24
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1559923704.4.0.972914893757.issue37180@roundup.psfhosted.org>
In-reply-to
Content
> Regarding the file named: "Lib/encodings/mac_farsi.py", the numbers are inserted in the wrong way, they are inserted Arabic numbers instead of Persian, they are edited in the comment.

Python implements the Unicode standard. In the master branch, it's the Unicode standard version 11.0. It gives these character names:

$ python3
>>> import unicodedata
>>> for ch in list(range(0x06f0, 0x06f9+1)) + [0x06A9]:
...  print("U+%04x: %s" % (ch, unicodedata.name(chr(ch))))
... 

U+06f0: EXTENDED ARABIC-INDIC DIGIT ZERO
U+06f1: EXTENDED ARABIC-INDIC DIGIT ONE
U+06f2: EXTENDED ARABIC-INDIC DIGIT TWO
U+06f3: EXTENDED ARABIC-INDIC DIGIT THREE
U+06f4: EXTENDED ARABIC-INDIC DIGIT FOUR
U+06f5: EXTENDED ARABIC-INDIC DIGIT FIVE
U+06f6: EXTENDED ARABIC-INDIC DIGIT SIX
U+06f7: EXTENDED ARABIC-INDIC DIGIT SEVEN
U+06f8: EXTENDED ARABIC-INDIC DIGIT EIGHT
U+06f9: EXTENDED ARABIC-INDIC DIGIT NINE
U+06a9: ARABIC LETTER KEHEH

>>> unicodedata.unidata_version
'11.0.0'

I still see "ARABIC" in character names.

> The KAF character (ك)

That's the Unicode character: U+0643 called "ARABIC LETTER KAF".

Comments in https://github.com/python/cpython/blob/master/Lib/encodings/mac_farsi.py still seems to be up to date.

SilentGhost:
> The replacement character that you're proposing is called (according to the same database) 'ARABIC LETTER KEHEH', whereas the old one was 'ARABIC LETTER KAF'. This encoding was originally generated based on data from unicode.org, I'd think a reference would be needed making clear that this is indeed a valid replacement.

mac_farsi.py docstring says:

""" Python Character Mapping Codec mac_farsi generated from 'MAPPINGS/VENDORS/APPLE/FARSI.TXT' with gencodec.py.

The mapping comes from Unicode. Was it updated since this file was created?

The latest change in this file was made in 2007, a few years ago :-)

--

I don't see anything wrong, I suggest to close the issue.
History
Date User Action Args
2019-06-07 16:08:24vstinnersetrecipients: + vstinner, lemburg, ronaldoussoren, ned.deily, ezio.melotti, SilentGhost, RaminNietzsche
2019-06-07 16:08:24vstinnersetmessageid: <1559923704.4.0.972914893757.issue37180@roundup.psfhosted.org>
2019-06-07 16:08:24vstinnerlinkissue37180 messages
2019-06-07 16:08:24vstinnercreate