"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Stefan Sperling <stsp@stsp.name>
Subject:
Re: got-notify-http: fix unicode handling
To:
op@omarpolo.com
Cc:
gameoftrees@openbsd.org
Date:
Thu, 4 Apr 2024 12:32:43 +0200

Download raw body.

Thread
On Thu, Apr 04, 2024 at 11:44:06AM +0200, op@omarpolo.com wrote:
> Il 2024-03-28 09:45 Stefan Sperling ha scritto:
> > Does the use of U+FFFD do something specific in JSON?
> > What about using '?' like we do in openbsd base tools?
> 
> I forgot to address this point, sorry.  U+FFFD is, IME, commonly used when
> encountering a decoding issue and aborting is not an option.  It could be
> used as a hint on the decoding side that there was an error in the original
> decoding of the message, although I'm not sure how many people are gonna
> check for it.  A '?' is a better option on user-facing programs.
> 
> Given this, I think both can work out well in practice, and will be happy to
> change the U+FFFD REPLACEMENT CHARACTER to a '?' if preferred.
> 
> 

Either is fine. I agree that fffd seems more suitable for JSON since
unicode is expected by all decoders.