From: Takashi Iwai Subject: Re: Alsa-lib strings? Date: Fri, 30 Sep 2016 10:41:55 +0200 Message-ID: References: <3bf2ac97-49f1-8191-94c8-76368b554ab1@ubuntu.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id 67FC726048C for ; Fri, 30 Sep 2016 10:41:55 +0200 (CEST) In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: Clemens Ladisch Cc: alsa-devel@alsa-project.org, David Henningsson List-Id: alsa-devel@alsa-project.org On Fri, 30 Sep 2016 09:50:57 +0200, Clemens Ladisch wrote: > > David Henningsson wrote: > > 1a) can I count on alsa-lib's strings (everything from card name and > > mixer identifiers to various descriptions) to be UTF-8 or perhaps > > even 7-bit? > > Alsa-lib itself does not care about the encoding. > > The strings are whatever the kernel uses. In practice, this almost > always means ASCII, but kernel policy is UTF-8. (At the moment, the > only way I know of to get a non-ASCII string is from a USB device.) > > Alsa-lib can also return strings from configuration files. These are > encoded in whatever the editor happens to use, i.e., in practice, UTF-8. > > > 1b) In what way can buggy drivers violate the answers to 1a? > > The USB driver is not buggy. :) But in theory, you could get any random > crap. > > For testing, you can change a card's "id" attribute in sysfs. The ID string should be OK, as it's filtered in copy_valid_id_string(). But the other name strings have no checks, thus may have non-ASCII letters (in theory). Takashi