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.web10.11289.1654602301021313278 for ; Tue, 07 Jun 2022 04:45:01 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=DezqgeZy; spf=pass (domain: gmail.com, ip: 209.85.166.49, mailfrom: ayushdevel1325@gmail.com) Received: by mail-io1-f49.google.com with SMTP id r200so9230687iod.5 for ; Tue, 07 Jun 2022 04:45:00 -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=ErEnChrxxuTn9zMepnACqxGSeU9j90ZitLtQxICC4YM=; b=DezqgeZyCy5+0otoB7h4ViGuMArm9gFgwdD9OefDEUMMtIRWbaojbdLWuiKKXeMxgT b5q5hSeoeSMLk8Jzy3I8uErJT7vvLc8o343FkkUntmvxuZEKq9OKfQBjw2noH2artPpN ZX4d+WvDjhdoYAhGB91IcxQ1TZc3CtvecCgAIFkGhWw7+oE4IbGUn5/4i0tpIKVSK+QW k7YMhOB5IFBRzuM5E3fW0j05rlF1GXq7jerF8hd/tmJkRDh99sJdtihx7KpK71LQkAiU 7wTKa1bFeuA9byI2PM6/bGMLaoqg3mZg51y8QhjRStQ/Gw8+Ppuc0g6lhihY91HioHnn PV6Q== 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=ErEnChrxxuTn9zMepnACqxGSeU9j90ZitLtQxICC4YM=; b=zVxf+V+rnGd9Pk/icgWCcKSjZBjeNa7plZYWtFFNvc6AByL39wWPddbeTkPZDckSEi TwidyFjqvjr8R+DF7XA+hTbY49TTaawDb0p0/jkWgrzQ0bj2mUNOyue41BjeyCBwM2db 9btjHnVbKri7nVBQT6YOWpX578I52fDRKPi5eUkHPPzF7c0eT0OEDIekOWEzE/HboktE iiBUrQQcoKWUy5EdDFqU7S6Ugg9ULrA6xaHTtgQOcHUCkOZoFEGeLB/IGBw+CaMXADvZ 32AH9IcrFvmvAeTm39A1IaFOwwKcGTA4rawpQiYAZ+pW9Cur5/Jp+ujzw28mqTxU7Csn +gcQ== X-Gm-Message-State: AOAM533MZgxhDslBIABKj+3XTHGo5C8lKKUuhbUfie1cV+MuhX4g7LAK KBXQ3xBfn+iXp7Zwzjj+rt0efiSlki/14Cg4yF4= X-Google-Smtp-Source: ABdhPJz6McpfjaoNVY85Bsrnb0xYbjO9beBlVO1CMVN6K3ttFlDo9g7QslPgueszFZDNSUefga8vbskzqiIIBDHNv9s= X-Received: by 2002:a05:6638:2615:b0:32e:d246:8e27 with SMTP id m21-20020a056638261500b0032ed2468e27mr15279068jat.7.1654602300476; Tue, 07 Jun 2022 04:45:00 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: "Ayush Singh" Date: Tue, 7 Jun 2022 17:14:49 +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" 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