Skip to content

Add support of KOI8-T encoding #66871

Closed
Closed

Description

@serhiy-storchaka
BPO 22681
Nosy @amauryfa, @jwilk, @ned-deily, @serhiy-storchaka
Files
  • encoding_koi8_t.patch
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/serhiy-storchaka'
    closed_at = <Date 2015-05-12.20:28:32.820>
    created_at = <Date 2014-10-20.17:49:30.945>
    labels = ['type-feature', 'library']
    title = 'Add support of KOI8-T encoding'
    updated_at = <Date 2015-05-12.22:13:32.308>
    user = 'https://github.com/serhiy-storchaka'

    bugs.python.org fields:

    activity = <Date 2015-05-12.22:13:32.308>
    actor = 'ned.deily'
    assignee = 'serhiy.storchaka'
    closed = True
    closed_date = <Date 2015-05-12.20:28:32.820>
    closer = 'serhiy.storchaka'
    components = ['Library (Lib)']
    creation = <Date 2014-10-20.17:49:30.945>
    creator = 'serhiy.storchaka'
    dependencies = []
    files = ['36983']
    hgrepos = []
    issue_num = 22681
    keywords = ['patch']
    message_count = 10.0
    messages = ['229739', '229740', '242964', '242978', '243006', '243016', '243017', '243020', '243021', '243026']
    nosy_count = 5.0
    nosy_names = ['amaury.forgeotdarc', 'jwilk', 'ned.deily', 'python-dev', 'serhiy.storchaka']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue22681'
    versions = ['Python 3.5']

    Activity

    1. serhiy-storchaka commented on Oct 20, 2014

      @serhiy-storchaka
      MemberAuthor

      KOI8-T is Tajik encoding partially compatible with KOI8-R. This is default encoding of Tajik locale tg_TJ in glibc (but in X11 locale.alias file it is KOI8-C, bpo-20087).

      Proposed patch adds support for this encoding. I have not found official mapping of KOI8-T and have used a table from Apple's implementation of libiconv. It matches a table in Wikipedia [2] and GNU iconv.

      [1] http://www.opensource.apple.com/source/libiconv/libiconv-4/libiconv/tests/KOI8-T.TXT
      [2] https://ru.wikipedia.org/wiki/КОИ-8 (Russian)

    2. added
      stdlibStandard Library Python modules in the Lib/ directory
      type-featureA feature request or enhancement
      on Oct 20, 2014
    3. serhiy-storchaka commented on Oct 20, 2014

      @serhiy-storchaka
      MemberAuthor

      Ah, actually Apple uses (a fork of) GNU libiconv. So I should correct links.

    4. serhiy-storchaka commented on May 12, 2015

      @serhiy-storchaka
      MemberAuthor

      Ping.

    5. amauryfa commented on May 12, 2015

      @amauryfa
      Contributor

      Looks good to me.

    6. python-dev commented on May 12, 2015

      python-devmannequin
      Mannequin

      New changeset 78de5d040492 by Serhiy Storchaka in branch 'default':
      Issue bpo-22681: Added support for the koi8_t encoding.
      https://hg.python.org/cpython/rev/78de5d040492

    7. ned-deily commented on May 12, 2015

      @ned-deily
      Member

      Lots of "LookupError: unknown encoding: koi8_t" test failures (on OS X 10.10) after this commit, for example, in test_codecs:

      ======================================================================
      ERROR: test_basics (test.test_codecs.BasicUnicodeTest)
      ----------------------------------------------------------------------

      Traceback (most recent call last):
        File "/py/dev/3x/source/Lib/test/test_codecs.py", line 1869, in test_basics
          name = codecs.lookup(encoding).name
      LookupError: unknown encoding: koi8_t

      ======================================================================
      ERROR: test_decoder_state (test.test_codecs.BasicUnicodeTest)
      ----------------------------------------------------------------------

      Traceback (most recent call last):
        File "/py/dev/3x/source/Lib/test/test_codecs.py", line 2024, in test_decoder_state
          self.check_state_handling_decode(encoding, u, u.encode(encoding))
      LookupError: unknown encoding: koi8_t

      ======================================================================
      ERROR: test_seek (test.test_codecs.BasicUnicodeTest)
      ----------------------------------------------------------------------

      Traceback (most recent call last):
        File "/py/dev/3x/source/Lib/test/test_codecs.py", line 1992, in test_seek
          reader = codecs.getreader(encoding)(io.BytesIO(s.encode(encoding)))
        File "/py/dev/3x/blds/uxd/../../source/Lib/codecs.py", line 998, in getreader
          return lookup(encoding).streamreader
      LookupError: unknown encoding: koi8_t

      Ran 211 tests in 5.970s

      FAILED (errors=5, skipped=17)

    8. ned-deily commented on May 12, 2015

      @ned-deily
      Member
    9. python-dev commented on May 12, 2015

      python-devmannequin
      Mannequin

      New changeset def3bab79c8f by Serhiy Storchaka in branch 'default':
      Added forgotten new files for issues bpo-22681 and bpo-22682.
      https://hg.python.org/cpython/rev/def3bab79c8f

    10. serhiy-storchaka commented on May 12, 2015

      @serhiy-storchaka
      MemberAuthor

      Thanks Ned. I just forgive to add new encoding files.

    11. ned-deily commented on May 12, 2015

      @ned-deily
      Member

      All better, thanks!

    12. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Labels

    stdlibStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions