From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-io1-f49.google.com (mail-io1-f49.google.com [209.85.166.49]) by mx.groups.io with SMTP id smtpd.web11.9561.1654589968894421952 for ; Tue, 07 Jun 2022 01:19:29 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=M9JjNGjr; spf=pass (domain: gmail.com, ip: 209.85.166.49, mailfrom: ayushdevel1325@gmail.com) Received: by mail-io1-f49.google.com with SMTP id 134so8431740iou.12 for ; Tue, 07 Jun 2022 01:19:28 -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=re0dfqg0fp86z/taCZ/+PZQ8/KNlva2fWfYOMdWBZx8=; b=M9JjNGjr0P+UEZ2pZpCkDKqY+Z+k14VWzTHPsHIVhbr9K8yHiqVFktAWASgW2yAe01 /PBnBjqk4f8R0zEfl+Jl6qgtHwD1ho+y/aVkVU4lKvmmY4dSXYQOSdQHoE4FB6mbWDKQ wrpNoEuJ+LlOJ4oiLbJ35RAcGSiyNHG97WJmZOyKYtoCYiod7o8wX+Van2OKVCKik0DB bGyg7PjFAMEFRoAH4pfX44rIZFy1ghi0uxXbaXWbP86IECMeHsPCahVICHe6RqytKron 8oXl9zRPztNu3RzhMht8qnpB04bbxVdF2UPDKj12Nv6fA592th4wUsuEWHpnbT5ZEAJx yYcA== 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=re0dfqg0fp86z/taCZ/+PZQ8/KNlva2fWfYOMdWBZx8=; b=AG5D/2FkMZ0jAIzSWe3o1T92LeGCtlag2ID5NOPIKgN3LFSgP79HJFtNVXSvLPys/H ZQ7tucY2++O4kaeL4eVqzforR56et/WtWUD/IHGd87iJ8xdZzaD5XWt0PBpdv+uPpLmr hgvitGpW+XqGA0a6QdpmWCKNkUpO2YrBPEtJpOMRZMrSmBz8hOrUKmXLnzTqunwosmFB 9VMz8hua8ebG2OKDGvHWkqtrGLBuszTx6wUXOWGvlipg5KIFRfWkA3FFuLYXa9QnCt5u 5kOoZ69+VsqzfUS6TSTpaf7C/UZ5BamSWRP/yCsD9wBWRhAUyQCv4czHMiX7J8u/Z4d6 PsgA== X-Gm-Message-State: AOAM5319uNj9EA1CQEyojlyPL34Zl0hBXfGGooZ0ek0bG538zFq9BTVd h/tR1u71TV9bWOsDiVlfuVRWaXmO0kszSmM4G0E= X-Google-Smtp-Source: ABdhPJxMhSP60/8Jj3LLW+7a3KWz7ookmnfgm8a2Mp1dsyMUwfzo/k9BRiKhwS/qW5SaFNWJFwzNMU1aW2E7STfGG84= X-Received: by 2002:a05:6638:168a:b0:331:9c9a:90b4 with SMTP id f10-20020a056638168a00b003319c9a90b4mr7219374jat.236.1654589968266; Tue, 07 Jun 2022 01:19:28 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: "Ayush Singh" Date: Tue, 7 Jun 2022 13:49:17 +0530 Message-ID: Subject: Re: [edk2-devel] Need clarification about UEFI Strings To: Pedro Falcato Cc: edk2-devel-groups-io Content-Type: text/plain; charset="UTF-8" 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