From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-il1-f182.google.com (mail-il1-f182.google.com [209.85.166.182]) by mx.groups.io with SMTP id smtpd.web08.10202.1656501357228828995 for ; Wed, 29 Jun 2022 04:15:57 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=aCECgJul; spf=pass (domain: gmail.com, ip: 209.85.166.182, mailfrom: ayushdevel1325@gmail.com) Received: by mail-il1-f182.google.com with SMTP id f15so9583540ilj.11 for ; Wed, 29 Jun 2022 04:15:57 -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=mMUg9bwMdePoGPaEwZCdbEQvy1LBVv/g3qV3LdeCk+g=; b=aCECgJulQKDNCWh2i3OP4NTNz7Yzp2bAefDglsF0xdEa6YfCJ6nfihBPfMLydwEF0/ OUZXpM4th+n9Qt9zw8lXQ/DeLUgEImufWQMGZxkNXoB5ieRm/QaOOFJgxJP0bQOF6SLr VAv3PbwHTRbtGgdyQV8sBKoEidSoN7q+AW/LsbsdsI/YOdKhIU0S/LjyfOfH631RwWia PnWcAiAeYgeTbfMbJw5+zkxz/KR4tZKDgHvg1TZkY0C4gPKWj/kvMWAIyh5Ijw/qT9p1 odx2Ey9K+OIlF2/PnErWDKikAemCnl5tCcWAPoPYQBgdoEERzL5UcnBuTQK4RV9qVYZA DNVQ== 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=mMUg9bwMdePoGPaEwZCdbEQvy1LBVv/g3qV3LdeCk+g=; b=331jkTzW5pUBE0P1QXUXVFvgcEOHZv3hUNkXE37VNfCl6iDhSRJCkWgcAAjB45iyNu DvT9EpJgwExrWLC2IIMvAjZcLWCPF36Pca1N5UHmGmx6DxHvZ99x32cMXoQia3pGmdt2 z2/0NGYoeDNuyw/zVXBf9AShND5sPnOHb3c9/SGfT31oewBpdpDRRKb6NclmnMdJWluE huLhQH6KdyhFq8jQgRqqYHsWlZdyU4EQpUQLrbfRBSRb+cKLbbE8o5emVS1ETXGJ9Y9Y Z1qz8+W/EhEes6Cq+X/ZjOUFD0TZU85KWiKpqwI9Akv6KbCbzLTE5j9oihlXpAbmEzVk 6thw== X-Gm-Message-State: AJIora/LwOhHRZUHE7abmqfLSa31AEE5EzbGIm7kDcLbqIfJ76jVTnAg 76Cm7NgcJOVGoYBuIGdIikVnGiET7AI97km8JxfY1NfqoE4= X-Google-Smtp-Source: AGRyM1vU5rFLBmipiesDhcR+jG/PEnaIVTJEQLc7eH1X6IMR3+lSgZPoOXkBKyuLz/PKmrBk7Ijn4abK3TcMN5MbOuo= X-Received: by 2002:a05:6e02:168c:b0:2da:971e:700c with SMTP id f12-20020a056e02168c00b002da971e700cmr1581837ila.311.1656501356442; Wed, 29 Jun 2022 04:15:56 -0700 (PDT) MIME-Version: 1.0 References: <16F65406CF53B1FF.10097@groups.io> In-Reply-To: <16F65406CF53B1FF.10097@groups.io> From: "Ayush Singh" Date: Wed, 29 Jun 2022 16:46:04 +0530 Message-ID: Subject: Re: [edk2-devel] Need clarification about UEFI Strings To: edk2-devel-groups-io , ayushdevel1325@gmail.com Cc: Pedro Falcato , Michael Kubacki , michael.d.kinney@intel.com, Jiewen Yao , jabeena.b.gaibusab@intel.com Content-Type: text/plain; charset="UTF-8" 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 wrote: > > Ok, Thanks for all the help. > > On Tue, Jun 7, 2022 at 3:28 PM Pedro Falcato 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 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 > > > > >