Ticket #3992 (closed defect: fixed)

Opened 4 months ago

Last modified 3 months ago

Incorrect display in Solaris encoding 1251

Reported by: shurik005 Owned by: andrew_b
Priority: minor Milestone: 4.8.24
Component: mc-core Version: master
Keywords: solaris, codepage, ansi1251 Cc:
Blocked By: Blocking:
Branch state: merged Votes for changeset: committed-master

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 4 months ago by andrew_b

Please translate to English.

comment:2 in reply to: ↑ 1 ; follow-up: ↓ 4 Changed 4 months 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 4 months ago by andrew_b

  • Description modified (diff)

comment:4 in reply to: ↑ 2 ; follow-up: ↓ 5 Changed 4 months 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 4 months ago by andrew_b (previous) (diff)

comment:5 in reply to: ↑ 4 ; follow-up: ↓ 6 Changed 4 months 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 4 months 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

comment:7 follow-up: ↓ 8 Changed 3 months ago by andrew_b

  • Owner set to andrew_b
  • Status changed from new to accepted
  • Branch state changed from no branch to on review
  • Milestone changed from Future Releases to 4.8.24

Branch: 3992_solaris_cp1251
changeset:d96fc0923bb576902e50a5a7a1dcf1ef810938bc

Please test.

comment:8 in reply to: ↑ 7 ; follow-up: ↓ 9 Changed 3 months ago by shurik005

Replying to andrew_b:

Branch: 3992_solaris_cp1251
changeset:d96fc0923bb576902e50a5a7a1dcf1ef810938bc

Please test.

Ok, but in mc.chaset need ANSI-1251\tWindows 1251

comment:9 in reply to: ↑ 8 Changed 3 months ago by andrew_b

Replying to shurik005:

Ok, but in mc.chaset need ANSI-1251\tWindows 1251

This is done in m4.include/mc-i18n.m4:

  • m4.include/mc-i18n.m4

    a b  
    2323        have_charset=yes 
    2424        charset_msg="yes" 
     25 
     26        dnl Solaris has different name of Windows 1251 encoding 
     27        case $host_os in 
     28            solaris*) 
     29                CP1251="ANSI1251" 
     30                ;; 
     31            *) 
     32                CP1251="CP1251" 
     33                ;; 
     34        esac 
     35 
     36        AC_SUBST(CP1251) 
    2537    fi 
    2638]) 

Two clarifications are required:

  • value of $host_os on your OS (you can find it in config.log file)
  • "ANSI1251" or "ANSI-1251" exactly
Last edited 3 months ago by andrew_b (previous) (diff)

comment:10 follow-up: ↓ 11 Changed 3 months ago by shurik005

$grep host_os ./config.log
host_os='solaris2.11'

if "ANSI1251" then working, but in Options/Display?? Bits are also defined by the Input / display codepage 7-bit ASCII, unlike other encodings.
if "ANSI-1251" then working all.

comment:11 in reply to: ↑ 10 Changed 3 months ago by andrew_b

Replying to shurik005:

$grep host_os ./config.log
host_os='solaris2.11'

Fine.

if "ANSI1251" then working, but in Options/Display?? Bits are also defined by the Input / display codepage 7-bit ASCII, unlike other encodings.
if "ANSI-1251" then working all.

I've added commit to the branch: [2488e9d4ffdd4e681f4c31ac8ecbeec0d8d77eb1]. It will be squashed before merged to master.

comment:12 Changed 3 months ago by shurik005

Fixed, tested on:

$uname -a
SunOS test 5.11 11.4.6.4.0 sun4v sparc sun4v Solaris

comment:13 Changed 3 months ago by andrew_b

  • Votes for changeset set to shurik005 andrew_b
  • Branch state changed from on review to approved

comment:14 Changed 3 months ago by andrew_b

  • Status changed from accepted to testing
  • Votes for changeset changed from shurik005 andrew_b to committed-master
  • Resolution set to fixed
  • Branch state changed from approved to merged

comment:15 Changed 3 months ago by andrew_b

  • Status changed from testing to closed
Note: See TracTickets for help on using tickets.