All of lore.kernel.org
 help / color / mirror / Atom feed
From: Samuel Thibault <samuel.thibault@gnu.org>
To: Kamil Rytarowski <n54@gmx.com>
Cc: qemu-devel@nongnu.org, kraxel@redhat.com, kamil@netbsd.org
Subject: Re: [Qemu-devel] [PATCHv3 1/2] ui/curses: Do not assume wchar_t contains unicode
Date: Sat, 27 Apr 2019 19:57:08 +0200	[thread overview]
Message-ID: <20190427175708.76nq4w2mdexb4gkp@function> (raw)
In-Reply-To: <73079d95-cf99-e0e3-c464-4568622f0008@gmx.com>

Kamil Rytarowski, le sam. 27 avril 2019 19:36:40 +0200, a ecrit:
> On 27.04.2019 18:30, Samuel Thibault wrote:
> > E.g. BSD and Solaris even use locale-specific encoding there.
> > 
> > We thus have to go through the native multibyte representation and use
> > mbtowc/wctomb to make a proper conversion.
> > 
> > Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
> 
> Both patches work for me on NetBSD/amd64 8.99.37 for qemu-system-x86_64.
> Borders are printed correctly.
> 
> Regarding the patch I'm not sure whether to use MB_LEN_MAX or MB_CUR_MAX?

I don't know if qemu can afford VLA?

> I'm also unsure whether to reset conversion state between a multibyte
> character and wide character, with: `mbtowc(NULL, 0, 0);`. It's
> recommended to use in code examples examples. I think it doesn't make
> any harm to use it.

Mmm, better yet, we should actually use mbrtowc and wcrtomb. I have
fixed this in my tree.

> I'm not sure if this is related, but "qemu-system-hppa -curses" is
> broken for me. I didn't use it in the past as it just recently acquired
> NetBSD guest support.
> 
> (lldb) bt
> libcurses.so.7`mvwadd_wchnstr(win=0x0000000000000000, y=<unavailable>,
> x=<unavailable>, wchstr=0x00007f7fffffe020, n=0) at add_wchstr.c:123
>   * frame #2: 0x000000000078629e
> qemu-system-hppa`curses_update(dcl=0x00007f7ff7bd8bc0, x=0, y=0, w=79,
> h=24) at curses.c:86:9
>     frame #3: 0x0000000000753dae
> qemu-system-hppa`dpy_text_update(con=0x00007f7ff7bae580, x=0, y=0, w=79,

> (lldb) p screenpad
> (WINDOW *) $2 = 0x0000000000000000

I don't think this is related at all, screenpad management is another
matter.

Samuel

WARNING: multiple messages have this Message-ID (diff)
From: Samuel Thibault <samuel.thibault@gnu.org>
To: Kamil Rytarowski <n54@gmx.com>
Cc: kamil@netbsd.org, qemu-devel@nongnu.org, kraxel@redhat.com
Subject: Re: [Qemu-devel] [PATCHv3 1/2] ui/curses: Do not assume wchar_t contains unicode
Date: Sat, 27 Apr 2019 19:57:08 +0200	[thread overview]
Message-ID: <20190427175708.76nq4w2mdexb4gkp@function> (raw)
Message-ID: <20190427175708.rsAPQU8kTaVhtmsj44dVdmqgZpVzbJdJ1ivHVOeJxvM@z> (raw)
In-Reply-To: <73079d95-cf99-e0e3-c464-4568622f0008@gmx.com>

Kamil Rytarowski, le sam. 27 avril 2019 19:36:40 +0200, a ecrit:
> On 27.04.2019 18:30, Samuel Thibault wrote:
> > E.g. BSD and Solaris even use locale-specific encoding there.
> > 
> > We thus have to go through the native multibyte representation and use
> > mbtowc/wctomb to make a proper conversion.
> > 
> > Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
> 
> Both patches work for me on NetBSD/amd64 8.99.37 for qemu-system-x86_64.
> Borders are printed correctly.
> 
> Regarding the patch I'm not sure whether to use MB_LEN_MAX or MB_CUR_MAX?

I don't know if qemu can afford VLA?

> I'm also unsure whether to reset conversion state between a multibyte
> character and wide character, with: `mbtowc(NULL, 0, 0);`. It's
> recommended to use in code examples examples. I think it doesn't make
> any harm to use it.

Mmm, better yet, we should actually use mbrtowc and wcrtomb. I have
fixed this in my tree.

> I'm not sure if this is related, but "qemu-system-hppa -curses" is
> broken for me. I didn't use it in the past as it just recently acquired
> NetBSD guest support.
> 
> (lldb) bt
> libcurses.so.7`mvwadd_wchnstr(win=0x0000000000000000, y=<unavailable>,
> x=<unavailable>, wchstr=0x00007f7fffffe020, n=0) at add_wchstr.c:123
>   * frame #2: 0x000000000078629e
> qemu-system-hppa`curses_update(dcl=0x00007f7ff7bd8bc0, x=0, y=0, w=79,
> h=24) at curses.c:86:9
>     frame #3: 0x0000000000753dae
> qemu-system-hppa`dpy_text_update(con=0x00007f7ff7bae580, x=0, y=0, w=79,

> (lldb) p screenpad
> (WINDOW *) $2 = 0x0000000000000000

I don't think this is related at all, screenpad management is another
matter.

Samuel


  reply	other threads:[~2019-04-27 17:57 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-27 16:30 [Qemu-devel] [PATCHv3 0/2] ui/curses: BSD portability fixes Samuel Thibault
2019-04-27 16:30 ` Samuel Thibault
2019-04-27 16:30 ` [Qemu-devel] [PATCH] curses: do not assume wchar_t contains unicode Samuel Thibault
2019-04-27 16:30   ` Samuel Thibault
2019-04-27 16:30 ` [Qemu-devel] [PATCHv3 1/2] ui/curses: Do " Samuel Thibault
2019-04-27 16:30   ` Samuel Thibault
2019-04-27 17:36   ` Kamil Rytarowski
2019-04-27 17:36     ` Kamil Rytarowski
2019-04-27 17:57     ` Samuel Thibault [this message]
2019-04-27 17:57       ` Samuel Thibault
2019-04-27 18:05       ` Kamil Rytarowski
2019-04-27 16:30 ` [Qemu-devel] [PATCHv3 2/2] ui/curses: manipulate cchar_t with standard curses functions Samuel Thibault
2019-04-27 16:30   ` Samuel Thibault

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=20190427175708.76nq4w2mdexb4gkp@function \
    --to=samuel.thibault@gnu.org \
    --cc=kamil@netbsd.org \
    --cc=kraxel@redhat.com \
    --cc=n54@gmx.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.