Ticket #3992 (new defect)

Opened 5 days ago

Last modified 3 days ago

Incorrect display in Solaris encoding 1251

Reported by: shurik005 Owned by:
Priority: minor Milestone: Future Releases
Component: mc-core Version: master
Keywords: solaris, codepage, ansi1251 Cc:
Blocked By: Blocking:
Branch state: no branch Votes for changeset:

Description (last modified by andrew_b) (diff)

Solaris uses the ANSI1251 encoding name than other systems, where CP1251 is usually. As a result, Cyrillic characters are replaced with questions when using this encoding, since mc switches to 7-bit ASCII. When str_8bit_encodings are added to the list of the values "ansi-1251", "ansi1251" in the file lib/strutil/strutil.c, everything displays correctly, but in Options/Display?? Bits are also defined by the Input / display codepage 7-bit ASCII, unlike other encodings.

root@test:~# LC_MESSAGES=C mc -F
Home directory: /root
Profile root directory: /root

[System data]
    Config directory: /usr/share/mc/
    Data directory:   /usr/share/mc/
    File extension handlers: /usr/share/mc/ext.d/
    VFS plugins and scripts: /usr/share/mc/
        extfs.d:        /usr/share/mc/extfs.d/
        fish:           /usr/share/mc/fish/

[User data]
    Config directory: /root/.config/mc/
    Data directory:   /root/.local/share/mc/
        skins:          /root/.local/share/mc/skins/
        extfs.d:        /root/.local/share/mc/extfs.d/
        fish:           /root/.local/share/mc/fish/
        mcedit macros:  /root/.local/share/mc/mc.macros
        mcedit external macros: /root/.local/share/mc/mcedit/macros.d/macro.*
    Cache directory:  /root/.cache/mc/
root@test:~# mc --configure-options
 '--prefix=/usr' '--sysconfdir=/usr/share' '--libexec=/usr/share' 'CFLAGS=-m32' 'LDFLAGS=-m32' 'CPPFLAGS=-m32'

Change History

comment:1 follow-up: ↓ 2 Changed 5 days ago by andrew_b

Please translate to English.

comment:2 in reply to: ↑ 1 ; follow-up: ↓ 4 Changed 5 days ago by shurik005

  • Summary changed from Некоррекное отображение в Solaris кодировки 1251 to Incorrect display in Solaris encoding 1251

Replying to andrew_b:

Please translate to English.

Solaris uses the ANSI1251 encoding name than other systems, where CP1251 is usually. As a result, Cyrillic characters are replaced with questions when using this encoding, since mc switches to 7-bit ASCII. When str_8bit_encodings are added to the list of the values "ansi-1251", "ansi1251" in the file lib/strutil/strutil.c, everything displays correctly, but in Options/Display? Bits are also defined by the Input / display codepage 7-bit ASCII, unlike other encodings.

comment:3 Changed 5 days ago by andrew_b

  • Description modified (diff)

comment:4 in reply to: ↑ 2 ; follow-up: ↓ 5 Changed 5 days ago by andrew_b

Replying to shurik005:

Solaris uses the ANSI1251 encoding name than other systems, where CP1251 is usually. As a result, Cyrillic characters are replaced with questions when using this encoding, since mc switches to 7-bit ASCII. When str_8bit_encodings are added to the list of the values "ansi-1251", "ansi1251" in the file lib/strutil/strutil.c, everything displays correctly, but in Options/Display? Bits are also defined by the Input / display codepage 7-bit ASCII, unlike other encodings.

You can add your encoding to mc.charset file. First column is charset name in terms of iconv, second column is display name.

The ANSI1251 charset is unknown for GNU iconv(1):

$ iconv -l | grep 1251
CP1251//
WINDOWS-1251//
$ 
Last edited 5 days ago by andrew_b (previous) (diff)

comment:5 in reply to: ↑ 4 ; follow-up: ↓ 6 Changed 3 days ago by shurik005

Replying to andrew_b:

You can add your encoding to mc.charset file. First column is charset name in terms of iconv, second column is display name.

The ANSI1251 charset is unknown for GNU iconv(1):

$ iconv -l | grep 1251
CP1251//
WINDOWS-1251//
$ 

I'm add encoding and replace CP1251 to ANSI1251 or ANSI-1251, but nothing effect. On Solaris:

root@test:~# iconv -l|grep 1251
    CP1251 (1251, ANSI-1251, WINDOWS-1251, win5),
    wchar_t-ansi-1251,

comment:6 in reply to: ↑ 5 Changed 3 days ago by shurik005

Upps, if compile with added ansi1251,ansi-1251 with change mc.charset then display correctly and Options/Display? bits detect fine. Thans

Note: See TracTickets for help on using tickets.