From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-vs1-f49.google.com (mail-vs1-f49.google.com [209.85.217.49]) by mx.groups.io with SMTP id smtpd.web08.10788.1654595905577949311 for ; Tue, 07 Jun 2022 02:58:25 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Hs+g2/Je; spf=pass (domain: gmail.com, ip: 209.85.217.49, mailfrom: pedro.falcato@gmail.com) Received: by mail-vs1-f49.google.com with SMTP id i186so16181070vsc.9 for ; Tue, 07 Jun 2022 02:58:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=MC/v+r1FRxbkooVTRvkpAvhReAW3qTCUnMhkVcWJ9KQ=; b=Hs+g2/JeTwqRYg0HfqKQJpZSt0RXyVEhlhIh5Xlvjqdvyq4LrnUVxw4PervS13sGBf 0bFvOIOZAkJWVAFGio8rRuRutXUhvwa/PVT7M9LUT05yRN2bLAW/ypaxSSyg6Kko9irQ j6wYr5A6mtxu83uQyutus/ddVcMGejlNrHB4EaDgh04ysuotdQvZnSojr7k+8B+CNxvq m4Zy95YV4AJQoF7/xSTXqvRl+KZsBt9sx6C1RabhP1e6jiU2R+9u+lQcVUf6J6yeHlfI 6wVhcm1Kq7EWk2eQ0lcYODVApdZP/IovwTXf0aP3vrs97krnc6j4ptaOMUtC9zBdCzhJ SD6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=MC/v+r1FRxbkooVTRvkpAvhReAW3qTCUnMhkVcWJ9KQ=; b=6LPXhTnhE5PGAFVM0/u8fLUY2344iIgylQxhODPDRuX94TEUQKTmHEKZnFI9wwNu87 bROa3JuMQUURqMkSETt1lG7BMJtqZc8gdwx+VqD0wSUBDnmes3YrlmAYuud5Zo9uDeTM uEAiIe0F+cxSTLC5NI4G/39isH5uDSC23oPDyAEf5VzL4Zdejf7MPaYoObYWLor0j3pX 5AqwqiqDhe0bcI6JVXSqGD/FL0TxorTB3DA69vE4DqqPnwAOyzCASAzetonNqFX1mhAS IAHklQPz6FB+t8pCsQhb3sKrUizM6SyyNX8Yqc3sLnpEvp6Sv9DQm+Rr5fm/N+TqWC/O zMSw== X-Gm-Message-State: AOAM533lApNytAaaIhe4hI1neTUQpdUth6PZIKE7YtU3GyOzPqH4d+Cp Ys2i24RBxPRPfPl5PHMLXcijrjhQLZvYuG+UY4Q= X-Google-Smtp-Source: ABdhPJw6sijdMhhD32oMZPgySDZOGLMCABQnFIRE4TymKg0UZU7aUqJc9azvjPaTtlTE65wTFKS2cU3jim5b/IeVqqs= X-Received: by 2002:a67:c018:0:b0:32d:7877:d73b with SMTP id v24-20020a67c018000000b0032d7877d73bmr11481300vsi.15.1654595904600; Tue, 07 Jun 2022 02:58:24 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: "Pedro Falcato" Date: Tue, 7 Jun 2022 10:58:14 +0100 Message-ID: Subject: Re: [edk2-devel] Need clarification about UEFI Strings To: Ayush Singh Cc: edk2-devel-groups-io Content-Type: multipart/alternative; boundary="00000000000023fd8805e0d8a1a2" --00000000000023fd8805e0d8a1a2 Content-Type: text/plain; charset="UTF-8" I'd say that it depends. But 98% of the strings you'll find in UEFI (including APIs) are UCS-2 CHAR16 strings. On Tue, Jun 7, 2022 at 9:19 AM Ayush Singh wrote: > Thanks, Pedro, > > However, according to the specs, it is possible to construct ASCII > Strings as well. So when would ASCII Strings be used over normal UCS-2 > Strings? > > Ayush Singh > > On Tue, Jun 7, 2022 at 1:13 PM Pedro Falcato > wrote: > > > > Hi Ayush, > > > > In the latest UEFI 2.9 spec, it's specified under 2.3.1 that CHAR8 > strings/characters are (usually) ASCII, and CHAR16 strings/characters are > (usually) UCS-2 (*not* UTF-16). > > > > On Tue, Jun 7, 2022 at 7:02 AM Ayush Singh > wrote: > >> > >> Hello everyone, I am trying to write an implementation for UEFI > >> strings in Rust and just wanted clarification about some things. > >> > >> Are UEFI Strings UTF-16 encoded? I have looked at some previous Rust > >> implementations for this and it seems UEFI does not support the whole > >> UTF-16 but rather only UCS-2 > >> (https://en.wikipedia.org/wiki/Universal_Coded_Character_Set) which is > >> a subset of UTF-16. > >> > >> There is also something called WTF-8 > >> (https://en.wikipedia.org/wiki/UTF-8#WTF-8) which Rust uses to > >> represent OsStrings in Windows which is supposed to use UTF-16 (?). > >> > >> Anyway, if someone can point me to the resources/specifications of > >> UEFI Strings, it would be a great help. > >> > >> Ayush Singh > >> > >> > >> > >> > >> > > > > > > -- > > Pedro Falcato > -- Pedro Falcato --00000000000023fd8805e0d8a1a2 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I'd say that it depends. But 98% of the strings you= 9;ll find in UEFI (including APIs) are UCS-2 CHAR16 strings.

On Tue, Jun 7, = 2022 at 9:19 AM Ayush Singh <ayushdevel1325@gmail.com> wrote:
Thanks, Pedro,

However, according to the specs, it is possible to construct ASCII
Strings as well. So when would ASCII Strings be used over normal UCS-2
Strings?

Ayush Singh

On Tue, Jun 7, 2022 at 1:13 PM Pedro Falcato <pedro.falcato@gmail.com> wrote: >
> Hi Ayush,
>
> In the latest UEFI 2.9 spec, it's specified under 2.3.1 that CHAR8= strings/characters are (usually) ASCII, and CHAR16 strings/characters are = (usually) UCS-2 (*not* UTF-16).
>
> On Tue, Jun 7, 2022 at 7:02 AM Ayush Singh <ayushdevel1325@gmail.com> wro= te:
>>
>> Hello everyone, I am trying to write an implementation for UEFI >> strings in Rust and just wanted clarification about some things. >>
>> Are UEFI Strings UTF-16 encoded? I have looked at some previous Ru= st
>> implementations for this and it seems UEFI does not support the wh= ole
>> UTF-16 but rather only UCS-2
>> (https://en.wikipedia.org/wiki/U= niversal_Coded_Character_Set) which is
>> a subset of UTF-16.
>>
>> There is also something called WTF-8
>> (https://en.wikipedia.org/wiki/UTF-8#WTF-8) wh= ich Rust uses to
>> represent OsStrings in Windows which is supposed to use UTF-16 (?)= .
>>
>> Anyway, if someone can point me to the resources/specifications of=
>> UEFI Strings, it would be a great help.
>>
>> Ayush Singh
>>
>>
>>
>>
>>
>
>
> --
> Pedro Falcato


--
Pedro Falcato
--00000000000023fd8805e0d8a1a2--