* Need clarification about UEFI Strings @ 2022-06-07 6:02 Ayush Singh 2022-06-07 7:43 ` [edk2-devel] " Pedro Falcato 0 siblings, 1 reply; 6+ messages in thread From: Ayush Singh @ 2022-06-07 6:02 UTC (permalink / raw) To: edk2-devel-groups-io 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 ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [edk2-devel] Need clarification about UEFI Strings 2022-06-07 6:02 Need clarification about UEFI Strings Ayush Singh @ 2022-06-07 7:43 ` Pedro Falcato 2022-06-07 8:19 ` Ayush Singh 0 siblings, 1 reply; 6+ messages in thread From: Pedro Falcato @ 2022-06-07 7:43 UTC (permalink / raw) To: edk2-devel-groups-io, ayushdevel1325 [-- Attachment #1: Type: text/plain, Size: 1004 bytes --] 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 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 [-- Attachment #2: Type: text/html, Size: 1682 bytes --] ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [edk2-devel] Need clarification about UEFI Strings 2022-06-07 7:43 ` [edk2-devel] " Pedro Falcato @ 2022-06-07 8:19 ` Ayush Singh 2022-06-07 9:58 ` Pedro Falcato 0 siblings, 1 reply; 6+ messages in thread From: Ayush Singh @ 2022-06-07 8:19 UTC (permalink / raw) To: Pedro Falcato; +Cc: edk2-devel-groups-io 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> 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 ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [edk2-devel] Need clarification about UEFI Strings 2022-06-07 8:19 ` Ayush Singh @ 2022-06-07 9:58 ` Pedro Falcato 2022-06-07 11:44 ` Ayush Singh [not found] ` <16F65406CF53B1FF.10097@groups.io> 0 siblings, 2 replies; 6+ messages in thread From: Pedro Falcato @ 2022-06-07 9:58 UTC (permalink / raw) To: Ayush Singh; +Cc: edk2-devel-groups-io [-- Attachment #1: Type: text/plain, Size: 1598 bytes --] 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 <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> > 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 [-- Attachment #2: Type: text/html, Size: 2609 bytes --] ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [edk2-devel] Need clarification about UEFI Strings 2022-06-07 9:58 ` Pedro Falcato @ 2022-06-07 11:44 ` Ayush Singh [not found] ` <16F65406CF53B1FF.10097@groups.io> 1 sibling, 0 replies; 6+ messages in thread From: Ayush Singh @ 2022-06-07 11:44 UTC (permalink / raw) To: Pedro Falcato; +Cc: edk2-devel-groups-io Ok, Thanks for all the help. On Tue, Jun 7, 2022 at 3:28 PM Pedro Falcato <pedro.falcato@gmail.com> wrote: > > 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 <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> 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 ^ permalink raw reply [flat|nested] 6+ messages in thread
[parent not found: <16F65406CF53B1FF.10097@groups.io>]
* Re: [edk2-devel] Need clarification about UEFI Strings [not found] ` <16F65406CF53B1FF.10097@groups.io> @ 2022-06-29 11:16 ` Ayush Singh 0 siblings, 0 replies; 6+ messages in thread From: Ayush Singh @ 2022-06-29 11:16 UTC (permalink / raw) To: edk2-devel-groups-io, ayushdevel1325 Cc: Pedro Falcato, Michael Kubacki, michael.d.kinney, Jiewen Yao, jabeena.b.gaibusab Just for clarification, UCS2 and not UTF-16 means there are no surrogate pairs right? Ayush Singh On Tue, Jun 7, 2022 at 5:15 PM Ayush Singh via groups.io <ayushdevel1325=gmail.com@groups.io> wrote: > > Ok, Thanks for all the help. > > On Tue, Jun 7, 2022 at 3:28 PM Pedro Falcato <pedro.falcato@gmail.com> wrote: > > > > 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 <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> 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 > > > > > ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2022-06-29 11:15 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2022-06-07 6:02 Need clarification about UEFI Strings Ayush Singh 2022-06-07 7:43 ` [edk2-devel] " Pedro Falcato 2022-06-07 8:19 ` Ayush Singh 2022-06-07 9:58 ` Pedro Falcato 2022-06-07 11:44 ` Ayush Singh [not found] ` <16F65406CF53B1FF.10097@groups.io> 2022-06-29 11:16 ` Ayush Singh
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox