Watch your string buffer sizes

Length restrictions for strings are potential bugs that can cause major problems. For example, a product build was broken because of the German translation for the following string:

"Press Ctrl+Alt+Del to restart."

When translated into German, this string almost doubled in size to:

"Drücken Sie Strg+Alt+Entf, um den Computer neu zu starten."

The increased string size caused the buffer to overflow, which in turn crashed the system. The message was supposed to go into a boot sector of a certain byte size, and there was no space for a longer message. The only thing that can be done for this type of problem is to make sure that you communicate to localizers how much room they have for their translation.

Along these same lines, buffer overruns are notorious for bugs even in unlocalized software. Localizing strings tends to reveal buffer overrun problems. These types of problems can be eliminated if buffers are dynamic or are allowed to have the maximum buffer size. Estimating size requirements will be discussed in the next section, which will explain how an optimal user interface design makes localization easier.