
298
|
Chapter 4: Encoding Methods
Testing
When dealing with encodings, which almost always involves transcoding between Uni-
code and legacy encodings, I cannot emphasize enough the importance of testing. Even
if the code conversion is between the various Unicode encodings, there are pitfalls, along
with special ranges of code points that require specic treatment, such as the Surrogates
Area.
e bottom line is that if there is a aw in the conversion table or algorithm, the result-
ing data loss can be disastrous for your customers. Developing a rigorous testing harness,
along with a clear method for verifying the results, is prudent. In fact, doing so is your
responsibility.