From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS22989 209.51.188.0/24 X-Spam-Status: No, score=-3.7 required=3.0 tests=AWL,BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 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 dcvr.yhbt.net (Postfix) with ESMTPS id E6C581F466 for ; Tue, 21 Jan 2020 01:00:57 +0000 (UTC) Received: from localhost ([::1]:46494 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ithua-0001Qf-FN for normalperson@yhbt.net; Mon, 20 Jan 2020 20:00:56 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:41199) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ithuL-0001Or-ST for bug-gnulib@gnu.org; Mon, 20 Jan 2020 20:00:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ithuK-0003nt-N8 for bug-gnulib@gnu.org; Mon, 20 Jan 2020 20:00:41 -0500 Received: from mo6-p00-ob.smtp.rzone.de ([2a01:238:20a:202:5300::11]:27467) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ithuJ-0003mR-UE for bug-gnulib@gnu.org; Mon, 20 Jan 2020 20:00:40 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1579568436; s=strato-dkim-0002; d=clisp.org; h=References:In-Reply-To:Message-ID:Date:Subject:To:From: X-RZG-CLASS-ID:X-RZG-AUTH:From:Subject:Sender; bh=4xq8uOMx1TchsG8nemmainvFJi0u7twXUQNGZi8EEFU=; b=MAr0+FSiroJjq+7qZw9AvaSF1wCUKVBDvKJRB6uTJZ5L6ELn+WssvSLhcJn1sKW+qG od4kSeU+b8tEe5/3wOm81DRuO+vJTZpxM9kvtWhSqcrSaN35UyDSWM8PAvIV9wsUsB/Q 9XE0KdomcqRZ8t1rn7ijvQ/LPmoeNW02Rp+0nybbU0rJgxT8me1SorfBqleE7Kd5Lsm9 B3EtW1bnKcIykrFFKtInH/q3a4eWQSKJnvbnIctpXZ1DmKuUS9HqkOghTC7s0jgJ+IUe h14v481a0V3EeqO01IXY/QpkUPdxD1N6YO9r/bvbwpKpnuQ5P69/DCIdcvduwMFt01iC qXAw== X-RZG-AUTH: ":Ln4Re0+Ic/6oZXR1YgKryK8brlshOcZlIWs+iCP5vnk6shH+AHjwLuWOH6fzxfs=" X-RZG-CLASS-ID: mo00 Received: from bruno.haible.de by smtp.strato.de (RZmta 46.1.5 DYNA|AUTH) with ESMTPSA id 506e28w0L10a36h (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (curve X9_62_prime256v1 with 256 ECDH bits, eq. 3072 bits RSA)) (Client did not present a certificate); Tue, 21 Jan 2020 02:00:36 +0100 (CET) From: Bruno Haible To: bug-gnulib@gnu.org Subject: Re: new module 'c32rtomb' Date: Tue, 21 Jan 2020 02:00:35 +0100 Message-ID: <7350876.Srr6Idky85@omega> User-Agent: KMail/5.1.3 (Linux/4.4.0-171-generic; KDE/5.18.0; x86_64; ; ) In-Reply-To: <3882108.BG1oNlTdmQ@omega> References: <3882108.BG1oNlTdmQ@omega> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a01:238:20a:202:5300::11 X-BeenThere: bug-gnulib@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Gnulib discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnulib-bounces+normalperson=yhbt.net@gnu.org Sender: "bug-gnulib" I wrote: > On FreeBSD 12 and Solaris 11.4, the > two encodings are different. The FreeBSD 12 wchar_t encoding is apparently > based on ISO 2022 (very old). > > The fix is to use mbrtoc32() on platforms where this is possible, namely > on FreeBSD. Actually, FreeBSD has a similar bug as Solaris 11.4. Therefore it is better to NOT use the system's mbrtoc32() on FreeBSD 12. 2020-01-20 Bruno Haible mbrtoc32: Add note about FreeBSD 12. * m4/mbrtoc32.m4 (gl_MBRTOC32_SANITYCHECK): Guess no also on FreeBSD. * doc/posix-functions/mbrtoc32.texi: Mention that FreeBSD 12 is also affected. diff --git a/doc/posix-functions/mbrtoc32.texi b/doc/posix-functions/mbrtoc32.texi index 9789bef..3151a09 100644 --- a/doc/posix-functions/mbrtoc32.texi +++ b/doc/posix-functions/mbrtoc32.texi @@ -20,7 +20,7 @@ glibc 2.19. @item This function does not recognize multibyte sequences that @code{mbrtowc} recognizes on some platforms: -Solaris 11.4, mingw, MSVC 14. +FreeBSD 12, Solaris 11.4, mingw, MSVC 14. @end itemize Portability problems not fixed by Gnulib: diff --git a/m4/mbrtoc32.m4 b/m4/mbrtoc32.m4 index 3dee900..a5dc51a 100644 --- a/m4/mbrtoc32.m4 +++ b/m4/mbrtoc32.m4 @@ -1,4 +1,4 @@ -# mbrtoc32.m4 serial 2 +# mbrtoc32.m4 serial 3 dnl Copyright (C) 2014-2020 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -136,10 +136,14 @@ AC_DEFUN([gl_MBRTOC32_SANITYCHECK], dnl is present. changequote(,)dnl case "$host_os" in - # Guess no on Solaris, native Windows. - solaris* | mingw*) gl_cv_func_mbrtoc32_sanitycheck="guessing no" ;; - # Guess yes otherwise. - *) gl_cv_func_mbrtoc32_sanitycheck="guessing yes" ;; + # Guess no on FreeBSD, Solaris, native Windows. + freebsd* | solaris* | mingw*) + gl_cv_func_mbrtoc32_sanitycheck="guessing no" + ;; + # Guess yes otherwise. + *) + gl_cv_func_mbrtoc32_sanitycheck="guessing yes" + ;; esac changequote([,])dnl if test $LOCALE_FR != none || test $LOCALE_ZH_CN != none; then @@ -176,8 +180,8 @@ int main () result |= 1; } } - /* This fails on Solaris 11.4: - mbrtoc32 returns (size_t)-1. + /* This fails on FreeBSD 12 and Solaris 11.4: + mbrtoc32 returns (size_t)-2 or (size_t)-1. mbrtowc returns 4 (correct). */ if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) {