public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "aburgess at redhat dot com" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug tui/28800] non-ascii character cannot display correctly in tui-mode's extended-prompt
Date: Thu, 27 Jan 2022 12:26:20 +0000	[thread overview]
Message-ID: <bug-28800-4717-KMpTL2vZl1@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-28800-4717@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=28800

Andrew Burgess <aburgess at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2022-01-27
                 CC|                            |aburgess at redhat dot com

--- Comment #2 from Andrew Burgess <aburgess at redhat dot com> ---
Andreas,

This is a slightly different issue you are seeing.  I'm guessing you have
gdb.prompt_hook set.  This ends up calling gdbpy_before_prompt_hook in
python.c.

If we assume Python 3 for a moment, then in this function we convert the prompt
to a unicode object, assuming UTF-8 encoding.  This unicode object is then
passed to the users python code.

If the user returns the same prompt unchanged, or even some other utf-8 encoded
prompt string, we then convert that string back to bytes using the
host_charset.

>From the error message you see, it would appear your hostchar set is maybe
'ascii'?  I'm guessing it's certainly not utf-8.

You could try: 'set host-charset UTF8' and see if the problem is resolved.

The asymmetry in our use of different unicode encodings seems like a bad thing
to me ... I wonder if we should just fix on one particular scheme, maybe utf-8
for some of the cases like this?

However, we should probably spin this conversation into a separate bug as this
is different to the original unicode within tui bug.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

  parent reply	other threads:[~2022-01-27 12:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-20 16:03 [Bug tui/28800] New: " wuzy01 at qq dot com
2022-01-20 16:11 ` [Bug tui/28800] " schwab@linux-m68k.org
2022-01-27 12:26 ` aburgess at redhat dot com [this message]
2023-05-24 15:40 ` vries at gcc dot gnu.org
2023-05-24 17:56 ` vries at gcc dot gnu.org
2023-05-26 13:26 ` vries at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-28800-4717-KMpTL2vZl1@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).