JDK-4219716 : InputStreamReader with SJIS conversion bug
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.nio.charsets
  • Affected Version: 1.1.7
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_nt
  • CPU: x86
  • Submitted: 1999-03-12
  • Updated: 1999-03-19
  • Resolved: 1999-03-19
Related Reports
Duplicate :  
Description

Name: vi73552			Date: 03/11/99


I have an input file encoded in cp932 (Japanese characters).
To open this file I use the following:
BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream("cp932.txt"), "SJIS"));
When I read this file it converts a double-byte character 0x7c81, which is a full-width character "-" and has a Unicode equivalent \uff0d to a different Unicode character - \u2212, which is also mapped to character "-" in some fonts (for example, Times New Roman), but is missing in MS Mincho font that is common font to display Japanese in Windows. That causes alignment problems when Japanese text is displayed.
(Review ID: 55348) 
======================================================================

Comments
WORK AROUND Name: vi73552 Date: 03/11/99 Replace the character \u2212 with \uff0d ======================================================================
11-06-2004

EVALUATION The SJIS converters follow the mappings defined by Unicode.org which is not identical to the mappings used on the Win32 platforms. In JDK 1.2 and 1.1.8, the MS932 converters have been introduced to be able to support Win32 (bug-for-bug) compatible mappings. Win32 platforms provide fonts based upon their mappings for the JIS X0208 characters. MS932 should be used for Win32 compatibility. masayoshi.okutsu@Eng 1999-03-19
19-03-1999