From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id A90083858D35 for ; Fri, 9 Jun 2023 10:21:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A90083858D35 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gnu.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gnu.org Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q7ZF6-0003qM-LP; Fri, 09 Jun 2023 06:21:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=OnTUlBM9Zkv9u3itjW3GOz78lf5twDeAyKr9PZh2k8c=; b=SWBTLXOcGM2M Fp4FAoPdD14GOpHylzTEzvIHFHf27a/OGEe9yuWD4mwCKPTYP1A0TpNTzU59rIKMEzXHXhRaof7pw V4C8v+MbGZGnFZpqy5+O1Pufx4R7IGUcGOkfF9nKwz4bUz+XPZCemHq96X2NY41vL74Eo7C4L3VWn 8qMfDOcPOyJANow3+Ma/WYmnPy21BYueOYmwU0kOz+Vsi6u9idwwVcD4C5wqX0DfkBw43QynNZ/OA VKWaTf+K7VsuFVda6CsjZKumdnKt8ZTXFcOpNXYp4ScixrW37DTH+npDb0iaXghN3aiigp3SnSF1R H+8XdPACCMfoqX7pK8VqNw==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q7ZF6-0007wk-5F; Fri, 09 Jun 2023 06:21:16 -0400 Date: Fri, 09 Jun 2023 13:21:25 +0300 Message-Id: <83pm650wd6.fsf@gnu.org> From: Eli Zaretskii To: Tom de Vries Cc: gdb-patches@sourceware.org, tom@tromey.com In-Reply-To: (message from Tom de Vries on Fri, 9 Jun 2023 11:34:28 +0200) Subject: Re: [PATCH] [gdb/tui] Handle unicode chars in prompt References: <20230526132512.29496-1-tdevries@suse.de> <83pm6njiwn.fsf@gnu.org> X-Spam-Status: No, score=1.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_BARRACUDACENTRAL,SPF_HELO_PASS,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: > Date: Fri, 9 Jun 2023 11:34:28 +0200 > Cc: gdb-patches@sourceware.org, tom@tromey.com > From: Tom de Vries > > > One additional caveat: "multibyte" != "UTF-8". There's more than one > > multibyte encoding, and the current locale could use some non-UTF-8 > > encoding instead. For example, some encoding of the ISO-2022 family. > > I'm not sure what this means for the issue at hand. > > > > AFAIU, interpreting the currently locale and encoding correctly is up to > mbrtowc, so as long as it does that correctly I think there's no problem. Depends on how and for what purposes will the is_mb_char function be used, I guess. If it is used to mean "is this a Unicode character encoded in UTF-8", then the results might not be what the caller expects.