On May 30, 2014, at 1:29 AM, cheney chen <wjch...@hotmail.com> wrote:

> Hi experts,
> 
> First of all, this is not a real use case so don't be surprised if it looks 
> to be strange question.
> 
> I tried to print a simple Chinese string on screen, e.g. Chinese welcome 
> string "欢迎您". Here is what I did (case is simplified wherever necessary).
> 
> CHAR16 WelcomeStr[4];
> ...
> WelcomeStr[0] = 0x6B22;
> WelcomeStr[1] = 0x8FCE;
> WelcomeStr[2] = 0x60A8;
> WelcomeStr[3] = L'\0';
> ...
> gST->ConOut->OutputString(gST->ConOut, WelcomeStr);
> ...
> 
> Is it a right way? And how/where to add these Unicode characters to firmware 
> image?
> 

You use the Hii protocol to add fonts. 

Take a look at the RegisterFontPackage() function in 
https://svn.code.sf.net/p/edk2/code/trunk/edk2/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c

The Graphics Console driver carries the basic Roman fonts. This is the only 
font available in the edk2 that I know about. But the infrastructure supports 
adding more fonts. 

> By the way, any doc to describe multi-language support in EDKII?
> 

Not sure about a doc? Localization is done via *.uni files. Here is an example 
one from the shell 
https://svn.code.sf.net/p/edk2/code/trunk/edk2/ShellPkg/Application/Shell/Shell.uni,
 you can have multiple languages per token. The default EFI language is used. 
The Shell uses the STRING_TOKEN() macro to access the string, and this is all 
taken care of via the build system. For the most part the shell uses the 
ShellPrintHiiEx(), so you can look that that to understand what Hii things are 
going on.

How Hii works is documented in the UEFI spec, and I assume one of the build 
specs talks about UNI files. 

If you have a terminal connection that supports UTF-8 it would Just Work(tm), 
assuming the terminal emulation program supported the font. 

Thanks,

Andrew Fish

> Thanks,
> Cheney
> ------------------------------------------------------------------------------
> Time is money. Stop wasting it! Get your web API in 5 minutes.
> www.restlet.com/download
> http://p.sf.net/sfu/restlet_______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/edk2-devel

------------------------------------------------------------------------------
Time is money. Stop wasting it! Get your web API in 5 minutes.
www.restlet.com/download
http://p.sf.net/sfu/restlet
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to