Example: Safe Conversion of Shift-JIS
The following example illustrates the problem with Shift-JIS
conversion to Unicode:
- A database contains characters encoded in Shift-JIS.
- A record in the database contains the Shift-JIS character 0x8790.
- A user enters the Shift-JIS character 0x8790 into a data entry form in a browser.
- The application receives the input form and converts the Shift-JIS character 0x8790 to the Unicode character U+2252.
- Because the database contains Shift-JIS encoded characters, the Unicode character U+2252 cannot be specified as part of the query.
- The application must convert U+2252 back to a Shift-JIS character. Both 0x8790 and 0x81e0 convert to U+2252. If the conversion process selects 0x81e0, the query returns no records.
To resolve this problem, you can use the Round Trip Safety Configuration utility to ensure that conversion is to 0x8790 and the record is found.