In my organization, we use the popular Subversion version control system.

I’m a Subversion fan, although I appreciate and enjoy git and Mercurial too.

There is one Subversion limitation, however, that especially affects UEFI BIOS developers—the inability to create patches on HII strings.  I’m constantly creating patches of source code in order to share changes with suppliers and partners.  Everything works well until I try to send patches of strings.

Some background:  HII is the Human Interface Infrastructure, the basic set of interfaces and standards for managing all types of user input with the BIOS.  HII is covered in §28 of the UEFI Spec (as of v2.4).  Naturally, an important component of HII is the set of text strings that are displayed on a console in order to communicate with the user.  §28.2.6 defines the format of these strings:

28.2.6 Strings
Strings in the UEFI environment are defined using UCS-2, which is a 16-bit-per-character representation. For user-interface purposes, strings are one of the types of resources which can be installed into the HII Database (see Section 28.2.9).

This is where the trouble begins. The limitation is described in Subversion bug 2194:  most non-ASCII based encodings, such as UTF-16, aren't supported by Subversion, and UCS-2 is a close relative and predecessor to the UTF-16 encoding.  Subversion, therefore, treats UEFI UCS-2 strings as if they were binary files.  Let’s say you make some changes that affect both code and text strings.  If you try to create a patch containing the UEFI strings, for example using TortoiseSVN, the result looks like:

image

Some have reported that they can work around this issue by changing MIME types.  However, that has NOT worked in my experience, and the reason why is explained by rockstar programmer Stefan Küng, the TortoiseSVN benevolent dictator for lifeAs he points out, it is actually quite dangerous to change the MIME properties of your files in this way.

There is much more technical exposition on the problem available for study—apparently this is a difficult problem to solve.  I won’t cut and paste it all here, but if you’re interested in reading further about it, see:

1. http://svn.apache.org/repos/asf/subversion/trunk/notes/diff-encodings.txt

2. http://subversion.1072662.n5.nabble.com/Create-Apply-Patch-UTF-16-and-binary-support-td181079.html

and of course the bug itself:

3.  http://subversion.tigris.org/issues/show_bug.cgi?id=2194

So, while this is not necessarily a BIOS-specific problem, it does have special significance for BIOS developers since our strings’ encoding type is not supported by Subversion.

Has anyone else run into this problem?  Did you find a solution?  Please leave a comment!

Post a Comment

Be sure to select an account profile (e.g. Google, OpenID, etc.) before typing your comment!