From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-vk1-f173.google.com (mail-vk1-f173.google.com [209.85.221.173]) by mx.groups.io with SMTP id smtpd.web12.9370.1654587823653861624 for ; Tue, 07 Jun 2022 00:43:43 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Tp8rgq+S; spf=pass (domain: gmail.com, ip: 209.85.221.173, mailfrom: pedro.falcato@gmail.com) Received: by mail-vk1-f173.google.com with SMTP id b81so7256431vkf.1 for ; Tue, 07 Jun 2022 00:43:43 -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; bh=soq1PfC9dVlwyAPjTfP4QTtyRmbsHJKEBDNl0aZmssk=; b=Tp8rgq+SWLZKr2KsOTwmY0DOqmyIcpDGTUe1UEEWmmFJ4RabVtBVoqUs7hyXy2Z9pk ysFohFenX4AuFLyQpM6Ay5tEGyDgf+a5s03gf2UzMVAf+Ne1g1w1SX54JApilrvq7qe+ 3kSOMLzhNWr0ZZ26vZ2egr3xrZUJt4qDbhOQZSCirS/0Zbwzmdsu5/C2WaxZ+AmcoP0S MNVOEjlv+M02h5iNupDJfdSVHXynO2oL3KLoQf1CHFTTdpRU/Gpw1u32hgVwfJPWjdsr Sob8e/7M1ijCBIA3hEcOQMEfTB9PVSzXdE2VCSbS6Cf1Bkgy89pF0YNM6rgIu7vakjHu UeAw== 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; bh=soq1PfC9dVlwyAPjTfP4QTtyRmbsHJKEBDNl0aZmssk=; b=RePIoCFZ09ZUACr8wg7rOFI6E965Zp+CYBK1jFQ6fdY20i1CLkyn8fJb7wSTmAGlLz ZTPH95mL8Lk1q9Xi5LnskhODYW+w0g9BK4jvrvWrkob/jOcOnhg72Se/Iyry7b7lSVAp 1A6QK4MvRuz+16bXtoEK6SMl7Dv9um8JxD8Gs+v3G10um08COwkqIfkUcfVxoz0wB3qi 793EJzbF9L1RsQCDnJiGJ+Z56sXiTYm5guPjzoe+mHp5MbFus1Xh2pL+8vpEC3+yuu2N C1MX7DjjXfCGLf3JH9HOzAFhMsSa2NpbmDv2U6HKN0xGII0TAdrdk3GvdN8gpM9qHmfI SzmA== X-Gm-Message-State: AOAM531MaKa0bc6G3zmcjvjrVJR7v3gxCULMmby/hd6n2lyWI3szdhsY +y0AV3Kz1QlV22RnFgNAnO+3gF3z/Mg0tF8QFfEBp+KGnlg= X-Google-Smtp-Source: ABdhPJx0KoE/w7auhV5UsnAOHzdnWCxhnl4ayhO+7+pvLTJiKQaLFjR0ESCZoSqZ8Pl8GrtLRfZD2Tb4oiLwC6xh6hE= X-Received: by 2002:a1f:2a01:0:b0:357:907f:7dea with SMTP id q1-20020a1f2a01000000b00357907f7deamr30824918vkq.7.1654587822342; Tue, 07 Jun 2022 00:43:42 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: "Pedro Falcato" Date: Tue, 7 Jun 2022 08:43:32 +0100 Message-ID: Subject: Re: [edk2-devel] Need clarification about UEFI Strings To: edk2-devel-groups-io , ayushdevel1325@gmail.com Content-Type: multipart/alternative; boundary="0000000000006686d605e0d6bf8b" --0000000000006686d605e0d6bf8b Content-Type: text/plain; charset="UTF-8" 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 --0000000000006686d605e0d6bf8b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
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> wrote:
Hello everyone, I am trying to w= rite 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
--0000000000006686d605e0d6bf8b--