Skip to content

Internationalization

Travis Goodspeed edited this page Jan 15, 2017 · 1 revision

Some Notes on Strings and Internationalization

Howdy y'all,

The MD380 firmware contains a number of strings, both English and Chinese, both UTF16 and ASCII. This document is intended to explain those strings, as well as how we might someday support internationalization.

Fonts

The MD380 firmware contains both a Latin font and a Chinese font. The Latin font we replace for aesthetics, while the Chinese font is overwritten with our firmware patches by the firmware linker.

ASCII Strings

ASCII strings are directly referenced by the uC/OS-II realtime operating system, which uses them to name the threads. This was very helpful in identifying the purposes of the different threads during early development, and it is still handy in getting a first foothold on new firmware versions.

UTF-16 Strings

The GUI and the USB stack are entirely UTF-16, with direct references from the USB code. Because the GUI can be switched between Chinese and English, there are no direct references between the GUI code and the UTF-16 strings in code memory. Most strings in the SPI Flash (Codeplug) are of this type.

You can find strings within the binary by running rabin2 from the Radare2 project. In the following examples, we dump strings from an unwrapped firmware image to reveal their addresses within the file. Memory addresses within firmware will be 0x0800c000 higher, so the "Edit Channel" string is at 0x080d1778 in device memory.

dell13% cd svn/md380tools/firmware/unwrapped
dell13% rabin2 -zzq D002.032.img | grep Chann
0xc5778 26 12 Edit Channel
0xc57cc 26 12 Channel Name
dell13% 

GUI strings are in multiple clumps, and they seem to be delimited by one or two null shorts.

UTF-16 String Lookup

The radio likely has some function, somewhere which looks up the localized string from an index. We've not yet identified that function or the tables that it uses.

Localization

For MD380Tools, we might like to replace firmware strings in order to add support for languages other than English. We are limited by a lack of accent marks in the font, but that might be cured by overloading Chinese characters or by extending the Latin font.

This code will be handled by the locales/ directory. It is being tracked as Issue #656.

Clone this wiki locally