Re: [PATCH] [gdb/cli] Don't emit emojis in MI

Tom Tromey <[email protected]>
Newsgroups gmane.comp.gdb.patches
Message-ID <[email protected]>
>>>>> "Tom" == Tom de Vries <[email protected]> writes:

Tom> I think we probably should encode unicode characters in MI error strings as
Tom> octal escapes, independent of the sevenbit-strings setting.  This patch does
Tom> not address this part.

I think there are some other bugs concerning this FWIW.

I tend to think MI should not set sevenbit-strings and should just use
the host encoding.  That way, clients could simply use UTF-8 and not
have to deal with the oddities here.

sevenbit-strings also seems pretty questionable to me.  Like maybe it
made sense in the ancient times before the charset code was written, but
nowadays I think it's just a mistake.

Tom> As for implementation, I introduced a function emoji_allowed alongside
Tom> can_emit_style_escape, which defaults to the value of can_emit_style_escape.

Seems reasonable though:

Tom> +  /* True if emojis are allowed on STREAM.  */
Tom> +  virtual bool emoji_allowed ()
Tom> +  {
Tom> +    /* By default, assume that emojis are not allowed on streams that don't
Tom> +       support ANSI escapes.  */
Tom> +    return can_emit_style_escape ();
Tom> +  }

...there's no present need for 'virtual' here, and if we do ever need
it, it is easy to add.  So I would suggest removing that.

Approved-By: Tom Tromey <[email protected]>

Tom
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.