weixin_39631689
weixin_39631689
2020-11-30 09:50

Choice menus do not support multibyte characters (was Cannot turn off PGP signing when LANG=lt_LT.UTF-8)

I'm unable to turn off PGP signing when I'm using NeoMutt in Lithuanian.

Expected Behaviour

  • I write an email, edit it, exit the editor
  • now I'm at the compose screen and I see "Saugumas: Pasirašyti (PGP/MIME)", which is the (correct) translation of "Security: Sign (PGP/MIME)"
  • I press p to change it
  • now I see "PGP: (š)ifruoti, pa(s)irašyti, pasirašyti k(a)ip, a(b)u, s/(m)ime ar (n)ereikia?", which is the (correct) translation of "PGP (e)ncrypt, (s)ign, sign (a)s, (b)oth, s/(m)ime or (c)lear?"
  • I press 'n' to clear it
  • I expect to see "Saugumas: Jokio", which would be the translation of "Security: None".

Actual Behaviour

  • the prompt is dismissed, but I still see "Saugumas: Pasirašyti (PGP/MIME)"

Steps to Reproduce

export LANG=lt_LT.UTF-8, add set pgp_autosign to your neomuttrc, run neomutt and follow the steps in the "Expected behaviour" section.

(Aside: I get confused by this ordering of sections in the issue template. I'm used to (1) steps to repro, (2) expected, (3) actual. Here it's 2-3-1.)

How often does this happen?

  • Always, for a long time. I became a neomutt translation to fix this bug! I always thought it was just a mixup in the translations (the prompt being translated and the "esabpc" list of possible choices not being translated). Then, when I fixed translations, I assumed the problem was differences between branches (master at the time I last compiled and translations at the time I last translated). Eventually I ran out of excuses and decided to file a bug.

  • Note, that this problem DOES NOT HAPPEN if I use neomutt in English (export LANGUAGE=en). I press c at the prompt, and I get the expected Security: None.

When did it start to happen?

  • When I upgraded Which version did you use to use? I don't know, it was years ago!

NeoMutt Version


NeoMutt 20200424
Copyright (C) 1996-2016 Michael R. Elkins ir kiti.
NeoMutt ateina ABSOLIUČIAI BE JOKIOS GARANTIJOS; dėl smulkmenų paleisk 'neomutt -vv.'
NeoMutt yra laisva programinė įranga, ir tu gali laisvai ją platinti su tam
tikromis sąlygomis; rašyk 'neomutt -vv' dėl smulkmenų.

System: Linux 5.4.0-26-generic (x86_64)
ncurses: ncurses 6.2.20200212 (compiled with 6.2.20200212)
libidn: 1.33 (compiled with 1.33)
GPGME: 1.13.1-unknown
GnuTLS: 3.6.13
libnotmuch: 5.2.0
storage: tokyocabinet

Configure options: --prefix=/usr --sysconfdir=/etc --with-mailpath=/var/mail --mixmaster --gnutls --gpgme --gss --sasl --lua --notmuch --tokyocabinet --full-doc

Compilation CFLAGS: -g -O2 -std=c99 -D_ALL_SOURCE=1 -D_GNU_SOURCE=1 -D__EXTENSIONS__ -I/usr/include -I/usr/include/lua5.3 -DNCURSES_WIDECHAR -isystem /usr/include/mit-krb5

Įprastos parinktys:
  +attach_headers_color +compose_to_sender +compress +cond_date +debug 
  +encrypt_to_self +forgotten_attachments +forwref +ifdef +imap +index_color 
  +initials +limit_current_thread +multiple_fcc +nested_if +new_mail +nntp +pop 
  +progress +quasi_delete +regcomp +reply_with_xorig +sensible_browser +sidebar 
  +skip_quoted +smtp +status_color +timeout +tls_sni +trash 

Kompiliavimo parinktys:
  -autocrypt +bkgdset +color +curs_set +fcntl -flock -fmemopen +futimens 
  +getaddrinfo +gnutls +gpgme +gss +hcache -homespool +idn +inotify 
  -locales_hack +lua -lz4 +meta +mixmaster +nls +notmuch -openssl +pgp +regex 
  +sasl +smime -sqlite +start_color +sun_attachment +typeahead -zlib -zstd 
MAILPATH="/var/mail"
MIXMASTER="mixmaster"
PKGDATADIR="/usr/share/neomutt"
SENDMAIL="/usr/sbin/sendmail"
SYSCONFDIR="/etc"

Jei norite daugiau sužinoti apie NeoMutt, aplankykite https://neomutt.org
Jei radote NeoMutt klaidą, praneškite apie ją
    https://github.com/neomutt/neomutt/issues
arba paštu į <neomutt-devel.org>
</neomutt-devel.org>

Extra Info

  • Operating System and its version: Ubuntu 20.04 LTS
  • Were you using multiple copies of NeoMutt at once? no
  • Were you using 'screen' or 'tmux'? no
  • Is your email local (maildir) or remote (IMAP)? local

该提问来源于开源项目:neomutt/neomutt

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

5条回答

  • weixin_39631689 weixin_39631689 5月前

    Just had a thought.

    
    #. L10N: PGP options
    #: ncrypt/crypt_gpgme.c:5676
    msgid "esabmc"
    msgstr "šsabmn"
    

    There's a multibyte character in the first position.

    Does mutt_multi_choice() handle multibyte characters? DOES IT RETURN A CHARACTER INDEX, OR DOES IT RETURN A BYTE OFFSET?

    点赞 评论 复制链接分享
  • weixin_39631689 weixin_39631689 5月前

    Does mutt_multi_choice() handle multibyte characters? DOES IT RETURN A CHARACTER INDEX, OR DOES IT RETURN A BYTE OFFSET?

    It returns a byte offset.

    https://github.com/neomutt/neomutt/blob/b59dbac21704a43996f4b4a4eb08cf4b7d1325af/gui/curs_lib.c#L1002-L1007

    Also TIL you can use numbers to pick choices, so I have a workaround (press 6) for now.

    点赞 评论 复制链接分享
  • weixin_39631689 weixin_39631689 5月前

    I don't suppose you'd consider supporting multibyte characters in prompts? This is, after all, C, you have to manipulate strings with bone tools and bits of raw leather...

    I'd better come up with some alternative translations...

    点赞 评论 复制链接分享
  • weixin_39631689 weixin_39631689 5月前

    I've fixed the translations. I won't mind if you close this bug as WONTFIX.

    点赞 评论 复制链接分享
  • weixin_39995297 weixin_39995297 5月前

    Thanks - I'll close this and have opened #2302 if anybody wants to take a chance at implementing it.

    点赞 评论 复制链接分享

相关推荐