From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3A063C43461 for ; Wed, 9 Sep 2020 12:56:44 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B5E5921941 for ; Wed, 9 Sep 2020 12:56:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ro2oxOvS" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B5E5921941 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:57554 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kFzeU-0003ke-Pd for qemu-devel@archiver.kernel.org; Wed, 09 Sep 2020 08:56:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53930) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kFzdM-0002Cp-6y; Wed, 09 Sep 2020 08:55:32 -0400 Received: from mail-lj1-x242.google.com ([2a00:1450:4864:20::242]:44836) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kFzdJ-00013Q-BZ; Wed, 09 Sep 2020 08:55:31 -0400 Received: by mail-lj1-x242.google.com with SMTP id b19so3347767lji.11; Wed, 09 Sep 2020 05:55:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:reply-to:from:date:message-id :subject:to:cc; bh=juauL75ug80LTc38xn2MfEn4iLIjdeYZWpHxodZf24M=; b=ro2oxOvShoCzGFDY4Q9pAasH+jaK5CJVkumYNojGpeHUAmwWOGjgW4NvFgGPGx7vYP HOm1Dpxjyty9xU/sj7A9zVrtILGSfw0wlehl1+/byJHdC2PSr4LM+/9qcL375VygyoiO gEGYZs9F82f3OdOrb/KOEmdzca01N/0HgS1SCZW+sjzNKLh4BElILrTcuj52i5KcVtiH bHrEGV2sFPJmZ/DxxRI7BjC341txkBb++Oq05yh7uRO4pwoJG9Io7Pklc8PgM4clX52y Y9KFB7pMh3+t67wQXujhQalTjqFdKI0J+rZ+Lm2F2aBwULNVWw4MutZA1me/WQoFkArI baOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=juauL75ug80LTc38xn2MfEn4iLIjdeYZWpHxodZf24M=; b=VMEC4bPSIUXn3H/kxz/GPwjyrWem5tHW9RmMmI0/z7rGF8crzBc5O7uwFhzTMNVMeh V6yPfjPaHm/4j1B4Bop2FQSbF9KWDdClB+glWyScDDtMMgKzFK2I1L4OKx/GhUuG9qZw Vf2AIsxgCIZF2DDuklkhdlSP2MNeqmMsoMKzfhDwErq34WP5lyj/nf316r/DmO1KtpqA O6ov63ppt90k80RX//avQy/CUQvI9NsDQNWAWeKEeXahjrkCj/X6WOlB4O882Lj4Ngzy smIyTNTNPShlrdglqTJyzitA2thdlo9lhqyACaUe8hNAiLUuujSy5Tr5l8dkoaH0JM+T UjkA== X-Gm-Message-State: AOAM5305ZxJymtydIda7rkEuCUv60ov12Oq1eMapjbdo6YZw6jV0Swk8 uDx96xF8J18B8WqGgRs661W/MDfCBR1KRkVLM3A= X-Google-Smtp-Source: ABdhPJwUkP7RUCxNvyMeFOOwBmdta5bRE3mpdKCYxv0D4F3ert3iYCh4rwgVqFh9C2ey1GhSCrpUBXEMjodj02F8CK4= X-Received: by 2002:a2e:8983:: with SMTP id c3mr1921945lji.171.1599656127012; Wed, 09 Sep 2020 05:55:27 -0700 (PDT) MIME-Version: 1.0 References: <20200909094617.1582-1-luoyonggang@gmail.com> <20200909094617.1582-4-luoyonggang@gmail.com> <20200909125049.GU1011023@redhat.com> In-Reply-To: <20200909125049.GU1011023@redhat.com> From: =?UTF-8?B?572X5YuH5YiaKFlvbmdnYW5nIEx1byk=?= Date: Wed, 9 Sep 2020 20:55:15 +0800 Message-ID: Subject: Re: [PATCH v2 03/21] configure: Fixes ncursesw detection under msys2/mingw and enable curses To: =?UTF-8?Q?Daniel_P=2E_Berrang=C3=A9?= Content-Type: multipart/alternative; boundary="00000000000036a32e05aee0f7ac" Received-SPF: pass client-ip=2a00:1450:4864:20::242; envelope-from=luoyonggang@gmail.com; helo=mail-lj1-x242.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: luoyonggang@gmail.com Cc: Kevin Wolf , Ed Maste , Qemu-block , Stefan Weil , Xie Changlong , Peter Lieven , qemu-level , Michael Roth , Richard Henderson , Gerd Hoffmann , Wen Congyang , Samuel Thibault , Max Reitz , Li-Wen Hsu , Markus Armbruster Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" --00000000000036a32e05aee0f7ac Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Sep 9, 2020 at 8:51 PM Daniel P. Berrang=C3=A9 wrote: > On Wed, Sep 09, 2020 at 05:45:59PM +0800, Yonggang Luo wrote: > > The mingw pkg-config are showing following absolute path and contains : > as the separator, > > so we must handling : properly. > > > > -D_XOPEN_SOURCE=3D600 -D_POSIX_C_SOURCE=3D199506L > -IC:/CI-Tools/msys64/mingw64/include/ncursesw:-I/usr/include/ncursesw: > > -DNCURSES_WIDECHAR -D_XOPEN_SOURCE=3D600 -D_POSIX_C_SOURCE=3D199506L -I= C > -pipe -lncursesw -lgnurx -ltre -lintl -liconv > > -DNCURSES_WIDECHAR -D_XOPEN_SOURCE=3D600 -D_POSIX_C_SOURCE=3D199506L -I= C > -lncursesw > > -DNCURSES_WIDECHAR -D_XOPEN_SOURCE=3D600 -D_POSIX_C_SOURCE=3D199506L -I= C > -lcursesw > > -DNCURSES_WIDECHAR /CI-Tools/msys64/mingw64/include/ncursesw -pipe > -lncursesw -lgnurx -ltre -lintl -liconv > > -DNCURSES_WIDECHAR /CI-Tools/msys64/mingw64/include/ncursesw -lncursesw > > -DNCURSES_WIDECHAR /CI-Tools/msys64/mingw64/include/ncursesw -lcursesw > > -DNCURSES_WIDECHAR -I/usr/include/ncursesw -pipe -lncursesw -lgnurx > -ltre -lintl -liconv > > -DNCURSES_WIDECHAR -I/usr/include/ncursesw -lncursesw > > -DNCURSES_WIDECHAR -I/usr/include/ncursesw -lcursesw > > > > msys2/mingw lacks the POSIX-required langinfo.h. > > > > gcc test.c -DNCURSES_WIDECHAR -I/mingw64/include/ncursesw -pipe > -lncursesw -lgnurx -ltre -lintl -liconv > > test.c:4:10: fatal error: langinfo.h: No such file or directory > > 4 | #include > > | ^~~~~~~~~~~~ > > compilation terminated. > > > > So we using g_get_codeset instead of nl_langinfo(CODESET) > > > > Signed-off-by: Yonggang Luo > > Reviewed-by: Gerd Hoffmann > > --- > > configure | 9 +++------ > > ui/curses.c | 10 +++++----- > > 2 files changed, 8 insertions(+), 11 deletions(-) > > > > diff --git a/configure b/configure > > index f4f8bc3756..2e6d54e15b 100755 > > --- a/configure > > +++ b/configure > > @@ -3653,8 +3653,8 @@ if test "$iconv" =3D "no" ; then > > fi > > if test "$curses" !=3D "no" ; then > > if test "$mingw32" =3D "yes" ; then > > - curses_inc_list=3D"$($pkg_config --cflags ncurses 2>/dev/null):" > > - curses_lib_list=3D"$($pkg_config --libs ncurses > 2>/dev/null):-lpdcurses" > > + curses_inc_list=3D"$($pkg_config --cflags ncursesw > 2>/dev/null):-I/${MSYSTEM,,}/include/ncursesw:" > > + curses_lib_list=3D"$($pkg_config --libs ncursesw > 2>/dev/null):-lncursesw" > > The original code would try ncurses via pkg-config and if that failed, > would > falback to pdcurses. > > The new code tries ncursesw via pkg-config and then tries ncursesw again > via manually specified args, and doesn't try ncurses or pdcurses at all. > Gotcha, Indeed $pkg_config --cflags ncurses can find curses on mingw32, the problem is onw mingw32 the include path have :, so we can not use : as the path sepaerator, for cross-paltform reason, which is best for path separator? > > This fixes your build as you've installed ncursesw, but breaks anyone > who was using ncurses or pdcurses previously. At least on Fedora only > pdcurses is available for mingw, so I don't think we should be dropping > this. It looks like we just need to check all three of ncursesw, ncurses > and pdcurses. > > Copying Samuel who introduced this logic originally in > commit 8ddc5bf9e5de51c2a4842c01dd3a97f5591776fd > > > else > > curses_inc_list=3D"$($pkg_config --cflags ncursesw > 2>/dev/null):-I/usr/include/ncursesw:" > > curses_lib_list=3D"$($pkg_config --libs ncursesw > 2>/dev/null):-lncursesw:-lcursesw" > > @@ -3664,17 +3664,14 @@ if test "$curses" !=3D "no" ; then > > #include > > #include > > #include > > -#include > > int main(void) { > > - const char *codeset; > > wchar_t wch =3D L'w'; > > setlocale(LC_ALL, ""); > > resize_term(0, 0); > > addwstr(L"wide chars\n"); > > addnwstr(&wch, 1); > > add_wch(WACS_DEGREE); > > - codeset =3D nl_langinfo(CODESET); > > - return codeset !=3D 0; > > + return 0; > > } > > EOF > > IFS=3D: > > diff --git a/ui/curses.c b/ui/curses.c > > index a59b23a9cf..12bc682cf9 100644 > > --- a/ui/curses.c > > +++ b/ui/curses.c > > @@ -30,7 +30,6 @@ > > #endif > > #include > > #include > > -#include > > #include > > > > #include "qapi/error.h" > > @@ -526,6 +525,7 @@ static void font_setup(void) > > iconv_t nativecharset_to_ucs2; > > iconv_t font_conv; > > int i; > > + g_autofree gchar *local_codeset =3D g_get_codeset(); > > > > /* > > * Control characters are normally non-printable, but VGA does hav= e > > @@ -566,14 +566,14 @@ static void font_setup(void) > > 0x25bc > > }; > > > > - ucs2_to_nativecharset =3D iconv_open(nl_langinfo(CODESET), "UCS-2"= ); > > + ucs2_to_nativecharset =3D iconv_open(local_codeset, "UCS-2"); > > if (ucs2_to_nativecharset =3D=3D (iconv_t) -1) { > > fprintf(stderr, "Could not convert font glyphs from UCS-2: > '%s'\n", > > strerror(errno)); > > exit(1); > > } > > > > - nativecharset_to_ucs2 =3D iconv_open("UCS-2", nl_langinfo(CODESET)= ); > > + nativecharset_to_ucs2 =3D iconv_open("UCS-2", local_codeset); > > if (nativecharset_to_ucs2 =3D=3D (iconv_t) -1) { > > iconv_close(ucs2_to_nativecharset); > > fprintf(stderr, "Could not convert font glyphs to UCS-2: > '%s'\n", > > @@ -581,7 +581,7 @@ static void font_setup(void) > > exit(1); > > } > > > > - font_conv =3D iconv_open(nl_langinfo(CODESET), font_charset); > > + font_conv =3D iconv_open(local_codeset, font_charset); > > if (font_conv =3D=3D (iconv_t) -1) { > > iconv_close(ucs2_to_nativecharset); > > iconv_close(nativecharset_to_ucs2); > > @@ -602,7 +602,7 @@ static void font_setup(void) > > /* DEL */ > > convert_ucs(0x7F, 0x2302, ucs2_to_nativecharset); > > > > - if (strcmp(nl_langinfo(CODESET), "UTF-8")) { > > + if (strcmp(local_codeset, "UTF-8")) { > > /* Non-Unicode capable, use termcap equivalents for those > available */ > > for (i =3D 0; i <=3D 0xFF; i++) { > > wchar_t wch[CCHARW_MAX]; > > -- > > 2.28.0.windows.1 > > > > > > Regards, > Daniel > -- > |: https://berrange.com -o- > https://www.flickr.com/photos/dberrange :| > |: https://libvirt.org -o- > https://fstop138.berrange.com :| > |: https://entangle-photo.org -o- > https://www.instagram.com/dberrange :| > > --=20 =E6=AD=A4=E8=87=B4 =E7=A4=BC =E7=BD=97=E5=8B=87=E5=88=9A Yours sincerely, Yonggang Luo --00000000000036a32e05aee0f7ac Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Wed, Sep 9, 2020 at 8:51 PM Daniel= P. Berrang=C3=A9 <berrange@redha= t.com> wrote:
On Wed, Sep 09, 2020 at 05:45:59PM +0800, Yonggang Luo wrote:
> The mingw pkg-config are showing following absolute path and contains = : as the separator,
> so we must handling : properly.
>
> -D_XOPEN_SOURCE=3D600 -D_POSIX_C_SOURCE=3D199506L -IC:/CI-Tools/msys64= /mingw64/include/ncursesw:-I/usr/include/ncursesw:
> -DNCURSES_WIDECHAR -D_XOPEN_SOURCE=3D600 -D_POSIX_C_SOURCE=3D199506L -= IC -pipe -lncursesw -lgnurx -ltre -lintl -liconv
> -DNCURSES_WIDECHAR -D_XOPEN_SOURCE=3D600 -D_POSIX_C_SOURCE=3D199506L -= IC -lncursesw
> -DNCURSES_WIDECHAR -D_XOPEN_SOURCE=3D600 -D_POSIX_C_SOURCE=3D199506L -= IC -lcursesw
> -DNCURSES_WIDECHAR /CI-Tools/msys64/mingw64/include/ncursesw -pipe -ln= cursesw -lgnurx -ltre -lintl -liconv
> -DNCURSES_WIDECHAR /CI-Tools/msys64/mingw64/include/ncursesw -lncurses= w
> -DNCURSES_WIDECHAR /CI-Tools/msys64/mingw64/include/ncursesw -lcursesw=
> -DNCURSES_WIDECHAR -I/usr/include/ncursesw -pipe -lncursesw -lgnurx -l= tre -lintl -liconv
> -DNCURSES_WIDECHAR -I/usr/include/ncursesw -lncursesw
> -DNCURSES_WIDECHAR -I/usr/include/ncursesw -lcursesw
>
> msys2/mingw lacks the POSIX-required langinfo.h.
>
> gcc test.c -DNCURSES_WIDECHAR -I/mingw64/include/ncursesw -pipe -lncur= sesw -lgnurx -ltre -lintl -liconv
> test.c:4:10: fatal error: langinfo.h: No such file or directory
>=C2=A0 =C2=A0 =C2=A04 | #include <langinfo.h>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0|=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ^~~~~~~~= ~~~~
> compilation terminated.
>
> So we using g_get_codeset instead of nl_langinfo(CODESET)
>
> Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
> ---
>=C2=A0 configure=C2=A0 =C2=A0|=C2=A0 9 +++------
>=C2=A0 ui/curses.c | 10 +++++-----
>=C2=A0 2 files changed, 8 insertions(+), 11 deletions(-)
>
> diff --git a/configure b/configure
> index f4f8bc3756..2e6d54e15b 100755
> --- a/configure
> +++ b/configure
> @@ -3653,8 +3653,8 @@ if test "$iconv" =3D "no" ; = then
>=C2=A0 fi
>=C2=A0 if test "$curses" !=3D "no" ; then
>=C2=A0 =C2=A0 if test "$mingw32" =3D "yes" ; then > -=C2=A0 =C2=A0 curses_inc_list=3D"$($pkg_config --cflags ncurses = 2>/dev/null):"
> -=C2=A0 =C2=A0 curses_lib_list=3D"$($pkg_config --libs ncurses 2&= gt;/dev/null):-lpdcurses"
> +=C2=A0 =C2=A0 curses_inc_list=3D"$($pkg_config --cflags ncursesw= 2>/dev/null):-I/${MSYSTEM,,}/include/ncursesw:"
> +=C2=A0 =C2=A0 curses_lib_list=3D"$($pkg_config --libs ncursesw 2= >/dev/null):-lncursesw"

The original code would try=C2=A0 ncurses via pkg-config and if that failed= , would
falback to pdcurses.

The new code tries ncursesw via pkg-config and then tries ncursesw again via manually specified args, and doesn't try=C2=A0 ncurses or pdcurses = at all.
Gotcha, Indeed=C2=A0=C2=A0 $pkg_config --cflags ncurses can find curses on mingw32, the problem is onw= mingw32 the include path
have :, so we can not use : as the path= sepaerator, for cross-paltform reason, which is best for path separator?= =C2=A0

This fixes your build as you've installed ncursesw, but breaks anyone who was using ncurses or pdcurses previously. At least on Fedora only
pdcurses is available for mingw, so I don't think we should be dropping=
this. It looks like we just need to check all three of ncursesw, ncurses and pdcurses.

Copying Samuel who introduced this logic originally in
commit 8ddc5bf9e5de51c2a4842c01dd3a97f5591776fd

>=C2=A0 =C2=A0 else
>=C2=A0 =C2=A0 =C2=A0 curses_inc_list=3D"$($pkg_config --cflags ncu= rsesw 2>/dev/null):-I/usr/include/ncursesw:"
>=C2=A0 =C2=A0 =C2=A0 curses_lib_list=3D"$($pkg_config --libs ncurs= esw 2>/dev/null):-lncursesw:-lcursesw"
> @@ -3664,17 +3664,14 @@ if test "$curses" !=3D "no"= ; ; then
>=C2=A0 #include <locale.h>
>=C2=A0 #include <curses.h>
>=C2=A0 #include <wchar.h>
> -#include <langinfo.h>
>=C2=A0 int main(void) {
> -=C2=A0 const char *codeset;
>=C2=A0 =C2=A0 wchar_t wch =3D L'w';
>=C2=A0 =C2=A0 setlocale(LC_ALL, "");
>=C2=A0 =C2=A0 resize_term(0, 0);
>=C2=A0 =C2=A0 addwstr(L"wide chars\n");
>=C2=A0 =C2=A0 addnwstr(&wch, 1);
>=C2=A0 =C2=A0 add_wch(WACS_DEGREE);
> -=C2=A0 codeset =3D nl_langinfo(CODESET);
> -=C2=A0 return codeset !=3D 0;
> +=C2=A0 return 0;
>=C2=A0 }
>=C2=A0 EOF
>=C2=A0 =C2=A0 IFS=3D:
> diff --git a/ui/curses.c b/ui/curses.c
> index a59b23a9cf..12bc682cf9 100644
> --- a/ui/curses.c
> +++ b/ui/curses.c
> @@ -30,7 +30,6 @@
>=C2=A0 #endif
>=C2=A0 #include <locale.h>
>=C2=A0 #include <wchar.h>
> -#include <langinfo.h>
>=C2=A0 #include <iconv.h>
>=C2=A0
>=C2=A0 #include "qapi/error.h"
> @@ -526,6 +525,7 @@ static void font_setup(void)
>=C2=A0 =C2=A0 =C2=A0 iconv_t nativecharset_to_ucs2;
>=C2=A0 =C2=A0 =C2=A0 iconv_t font_conv;
>=C2=A0 =C2=A0 =C2=A0 int i;
> +=C2=A0 =C2=A0 g_autofree gchar *local_codeset =3D g_get_codeset(); >=C2=A0
>=C2=A0 =C2=A0 =C2=A0 /*
>=C2=A0 =C2=A0 =C2=A0 =C2=A0* Control characters are normally non-printa= ble, but VGA does have
> @@ -566,14 +566,14 @@ static void font_setup(void)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 0x25bc
>=C2=A0 =C2=A0 =C2=A0 };
>=C2=A0
> -=C2=A0 =C2=A0 ucs2_to_nativecharset =3D iconv_open(nl_langinfo(CODESE= T), "UCS-2");
> +=C2=A0 =C2=A0 ucs2_to_nativecharset =3D iconv_open(local_codeset, &qu= ot;UCS-2");
>=C2=A0 =C2=A0 =C2=A0 if (ucs2_to_nativecharset =3D=3D (iconv_t) -1) { >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 fprintf(stderr, "Could not conv= ert font glyphs from UCS-2: '%s'\n",
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 strerror(errno));
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 exit(1);
>=C2=A0 =C2=A0 =C2=A0 }
>=C2=A0
> -=C2=A0 =C2=A0 nativecharset_to_ucs2 =3D iconv_open("UCS-2",= nl_langinfo(CODESET));
> +=C2=A0 =C2=A0 nativecharset_to_ucs2 =3D iconv_open("UCS-2",= local_codeset);
>=C2=A0 =C2=A0 =C2=A0 if (nativecharset_to_ucs2 =3D=3D (iconv_t) -1) { >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 iconv_close(ucs2_to_nativecharset);<= br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 fprintf(stderr, "Could not conv= ert font glyphs to UCS-2: '%s'\n",
> @@ -581,7 +581,7 @@ static void font_setup(void)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 exit(1);
>=C2=A0 =C2=A0 =C2=A0 }
>=C2=A0
> -=C2=A0 =C2=A0 font_conv =3D iconv_open(nl_langinfo(CODESET), font_cha= rset);
> +=C2=A0 =C2=A0 font_conv =3D iconv_open(local_codeset, font_charset);<= br> >=C2=A0 =C2=A0 =C2=A0 if (font_conv =3D=3D (iconv_t) -1) {
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 iconv_close(ucs2_to_nativecharset);<= br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 iconv_close(nativecharset_to_ucs2);<= br> > @@ -602,7 +602,7 @@ static void font_setup(void)
>=C2=A0 =C2=A0 =C2=A0 /* DEL */
>=C2=A0 =C2=A0 =C2=A0 convert_ucs(0x7F, 0x2302, ucs2_to_nativecharset);<= br> >=C2=A0
> -=C2=A0 =C2=A0 if (strcmp(nl_langinfo(CODESET), "UTF-8")) {<= br> > +=C2=A0 =C2=A0 if (strcmp(local_codeset, "UTF-8")) {
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 /* Non-Unicode capable, use termcap = equivalents for those available */
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 for (i =3D 0; i <=3D 0xFF; i++) {=
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 wchar_t wch[CCHARW_MAX= ];
> --
> 2.28.0.windows.1
>
>

Regards,
Daniel
--
|: ht= tps://berrange.com=C2=A0 =C2=A0 =C2=A0 -o-=C2=A0 =C2=A0 h= ttps://www.flickr.com/photos/dberrange :|
|: htt= ps://libvirt.org=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0-o-=C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 https://fstop138.berrange.com :|
|: https://entangle-photo.org=C2=A0 =C2=A0 -o-=C2=A0 =C2=A0 = https://www.instagram.com/dberrange :|



--
=C2=A0 =C2=A0 =C2=A0 =C2=A0=C2=A0 =E6=AD=A4=E8= =87=B4
=E7=A4=BC
=E7=BD=97=E5=8B=87=E5=88=9A
Yours
=C2=A0 =C2= =A0 sincerely,
Yonggang Luo
--00000000000036a32e05aee0f7ac--