Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: Tom Tromey <tom@tromey.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 2/3] [gdb/contrib] Fix UnicodeDecodeError in dwarf-to-dwarf-assembler.py
Date: Wed, 10 Jun 2026 11:12:34 +0200	[thread overview]
Message-ID: <9f5dcdf7-f51b-4a7a-8903-6fd072876fea@suse.de> (raw)
In-Reply-To: <87wlw7ej6u.fsf@tromey.com>

On 6/9/26 7:07 PM, Tom Tromey wrote:
>>>>>> "Tom" == Tom de Vries <tdevries@suse.de> writes:
> 
> Tom> +                return self._format_str(self.value.decode("ascii"))
> 
> Probably we should decode using UTF-8 here, maybe with some fallback
> setting, like errors='replace', see
> 
> https://docs.python.org/3/library/stdtypes.html#bytes.decode
> 
> The choice of encoding is a bit tricky since technically DWARF only uses
> Unicode when some other flag is seen.  However I think it's normally
> fine and expected.
> 

Thanks for the review.

I've pushed this:
...
-            return self._format_str(self.value.decode("ascii"))
+            return self._format_str(self.value.decode("UTF-8", 
"backslashreplace"))
...

Thanks,
- Tom

> Tom


  reply	other threads:[~2026-06-10  9:13 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-08 12:54 [PATCH 0/3] [gdb/contrib] Some dwarf-to-dwarf-assembler.py fixes Tom de Vries
2026-06-08 12:54 ` [PATCH 1/3] [gdb/contrib] Fix KeyError in dwarf-to-dwarf-assembler.py Tom de Vries
2026-06-09 17:04   ` Tom Tromey
2026-06-10  7:57     ` Tom de Vries
2026-06-10 13:23       ` Tom Tromey
2026-06-08 12:54 ` [PATCH 2/3] [gdb/contrib] Fix UnicodeDecodeError " Tom de Vries
2026-06-09 17:07   ` Tom Tromey
2026-06-10  9:12     ` Tom de Vries [this message]
2026-06-08 12:54 ` [PATCH 3/3] [gdb/contrib] Fix ELFParseError " Tom de Vries
2026-06-08 13:18   ` Tom de Vries
2026-06-09 17:08   ` Tom Tromey

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=9f5dcdf7-f51b-4a7a-8903-6fd072876fea@suse.de \
    --to=tdevries@suse.de \
    --cc=gdb-patches@sourceware.org \
    --cc=tom@tromey.com \
    /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