118 Part I: Core Ideas
Of course, it is necessary to ensure the translation is into a character set that makes
sense. It would be possible to go from an expanded character set like UTF-8 to a more
limited one like ASCII and lose values, but to avoid addressing potential programmer
errors, we’ll simply restate the main point you must remember here: when using an XHR
object you should always be using the UTF-8 character set.
TTIPIP A common mistake some noninternationalization-aware developers make is not saving their
code and XHTML files in the appropriate format. Make sure your editor is saving in UTF-8 or
the appropriate format as defaults may not be what you want.
Data Format Decisions
Choosing a data format for an Ajax application is influenced primarily by the following
three factors:
- Ease of encoding and decoding the data format
- Security benefits provided by the data format
- Transmission efficiency of the format
Each of these factors are discussed separately.
FIGURE 4-2 Character sets working correctly