All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laszlo Ersek <lersek@redhat.com>
To: Eric Blake <eblake@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	qemu-devel@nongnu.org
Cc: armbru@redhat.com
Subject: Re: [Qemu-devel] [PATCH v2 2/4] qjson: do not save/restore contexts
Date: Mon, 23 Nov 2015 21:26:18 +0100	[thread overview]
Message-ID: <5653766A.3090300@redhat.com> (raw)
In-Reply-To: <56537170.8070600@redhat.com>

On 11/23/15 21:05, Eric Blake wrote:
> On 11/23/2015 10:59 AM, Laszlo Ersek wrote:
>> On 11/23/15 18:44, Paolo Bonzini wrote:
>>> JSON is LL(1) and our parser indeed needs only 1 token lookahead.
>>> Saving the parser context is mostly unnecessary; we can replace it
>>> with peeking at the next token, or remove it altogether when the
>>> restore only happens on errors.  The token list is destroyed anyway
>>> on errors.
>>>
>>> The only interesting thing is that parse_keyword always eats
>>> a TOKEN_KEYWORD, even if it is invalid, so it must come last in
>>> parse_value (otherwise, NULL is returned, parse_literal is invoked
>>> and it tries to peek beyond end of input).  This is caught by
>>> /errors/unterminated/literal, which actually checks for an unterminated
>>> keyword. ಠ_ಠ
>>
>> Is it accepted practice to put UTF-8 in commit messages? (Or, actually,
>> anywhere in patches, except maybe the notes section?)
>>
> 
> Git handles UTF-8 just fine (and for any other encoding, properly
> transmitted in the email, git transcodes to UTF-8 before writing it into
> the repository).
> 

Yes, I know. I use latin2:

$ locale

LANG=
LC_CTYPE=hu_HU.ISO8859-2
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=

and from my git config:

[i18n]
	logOutputEncoding = latin2
	commitencoding = latin2

This works very well -- as long as it doesn't choke on something outside
of latin2 --, both the glibc locale support and git are doing their jobs
perfectly fine; my question concerned any other users who decided to
stay with single-byte encodings (with an ASCII subset).

(I believe that RFCs stick with ASCII to this day, and I also think that
our source code and docs/ should stick with ASCII; but I know I can't
plausibly argue for the same in commit messages, assuming I'm alone with
that anyway.

BTW I should have written "non-ASCII Unicode code points" in my original
question, rather than "UTF-8".)

Thanks!
Laszlo

  reply	other threads:[~2015-11-23 20:26 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-23 17:44 [Qemu-devel] [PATCH v2 for-2.5? 0/4] qjson: save a lot of memory Paolo Bonzini
2015-11-23 17:44 ` [Qemu-devel] [PATCH v2 1/4] qjson: replace QString in JSONLexer with GString Paolo Bonzini
2015-11-25 12:48   ` Markus Armbruster
2015-11-25 13:34     ` Paolo Bonzini
2015-11-23 17:44 ` [Qemu-devel] [PATCH v2 2/4] qjson: do not save/restore contexts Paolo Bonzini
2015-11-23 17:59   ` Laszlo Ersek
2015-11-23 18:09     ` Paolo Bonzini
2015-11-23 19:18       ` Laszlo Ersek
2015-11-23 20:05     ` Eric Blake
2015-11-23 20:26       ` Laszlo Ersek [this message]
2015-11-24  8:03     ` Gerd Hoffmann
2015-11-24 10:50       ` Laszlo Ersek
2015-11-24 11:18         ` Paolo Bonzini
2015-11-24 12:44           ` Fam Zheng
2015-11-24 12:54             ` Paolo Bonzini
2015-11-24 13:15               ` Markus Armbruster
2015-11-24 11:33         ` Gerd Hoffmann
2015-11-24 11:39         ` Laszlo Ersek
2015-11-25 14:32   ` Markus Armbruster
2015-11-23 17:44 ` [Qemu-devel] [PATCH v2 3/4] qjson: store tokens in a GQueue Paolo Bonzini
2015-11-23 17:44 ` [Qemu-devel] [PATCH v2 4/4] qjson: surprise, allocating 6 QObjects per token is expensive Paolo Bonzini
2015-11-23 21:00 ` [Qemu-devel] [PATCH v2 for-2.5? 0/4] qjson: save a lot of memory Eric Blake
2015-11-25 14:47 ` Markus Armbruster
2015-11-25 18:08   ` Paolo Bonzini
2015-11-25 18:34     ` Markus Armbruster

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=5653766A.3090300@redhat.com \
    --to=lersek@redhat.com \
    --cc=armbru@redhat.com \
    --cc=eblake@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.