From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 732 invoked by alias); 19 Dec 2019 17:22:26 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 720 invoked by uid 89); 19 Dec 2019 17:22:26 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-8.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS autolearn=ham version=3.3.1 spammy=H*f:sk:831rt02, H*i:sk:831rt02 X-HELO: gateway32.websitewelcome.com Received: from gateway32.websitewelcome.com (HELO gateway32.websitewelcome.com) (192.185.145.18) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 19 Dec 2019 17:22:25 +0000 Received: from cm13.websitewelcome.com (cm13.websitewelcome.com [100.42.49.6]) by gateway32.websitewelcome.com (Postfix) with ESMTP id 7B3D011650A6 for ; Thu, 19 Dec 2019 11:22:22 -0600 (CST) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id hzVGiuY493Qi0hzVGiloeu; Thu, 19 Dec 2019 11:22:22 -0600 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=GWsUmNcAxypNcgwsigLLZDBsSuAiYbXPPWw8HDIqv1k=; b=ht7hgXkU+6ATokcZRc1peiczjQ iCZBn7JMB54iqrX1kzHuUk6ySU0wFnHa5+USa3znX1URijtYWDh8D+rfPOhk0K4cfsxPDPnVXMKq7 u48ZvUk+cqJB/W2YqrZKAi47Q; Received: from 75-166-123-50.hlrn.qwest.net ([75.166.123.50]:41952 helo=murgatroyd) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1ihzVG-000mcX-8a; Thu, 19 Dec 2019 10:22:22 -0700 From: Tom Tromey To: Eli Zaretskii Cc: gdb@sourceware.org Subject: Re: Thread names and non-ASCII characters References: <831rt02vlb.fsf@gnu.org> Date: Thu, 19 Dec 2019 17:22:00 -0000 In-Reply-To: <831rt02vlb.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 19 Dec 2019 17:17:36 +0200") Message-ID: <87lfr8cjsi.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2019-12/txt/msg00040.txt.bz2 >>>>> "Eli" == Eli Zaretskii writes: Eli> Can someone tell what GDB assumes to be the character encoding used by Eli> thread names we get from the system APIs (such as pthread_getname_np)? Eli> It sounds like we assume the host character set, since the functions Eli> used to display the thread name don't perform any encoding conversion. Eli> Is my understanding correct? Yes, I believe so. Eli> I'm asking because Windows 10 introduces a new API for setting and Eli> getting a thread's name, but this API wants a UTF-16 encoded string, Eli> so if we want to use it, we need to decide from/to what encoding to Eli> convert to/from UTF-16. Converting to the host charset is probably the thing to do. If the host charset is decided incorrectly, then enhancing charset.c to choose a better one would help in other places as well. convert_between_encodings can be used to do the translation. Tom