nikhil1511 opened a new pull request, #1518:
URL: https://github.com/apache/poi/pull/1518

   ### Summary
   
   Updates `CodePageUtil.codepageToEncoding` so Windows code pages `932` 
(`CP_SJIS`) and `950` map to Microsoft's charset tables rather than strict JIS 
`Shift_JIS` and IBM `x-IBM950`:
   
   - `932` (`CP_SJIS`): returns `"MS932"` (`javaLangFormat == true`) and 
`"windows-31j"` (`javaLangFormat == false`), preserving NEC special characters 
(`①`, `㈱`) and IBM extensions (`髙`). `CP_MAC_JAPAN` (`10001`) continues to 
return `"SJIS"`.
   - `950`: returns `"MS950"` (`javaLangFormat == true`) and `"x-windows-950"` 
(`javaLangFormat == false`) instead of falling through to `"cp950"` (an alias 
for `x-IBM950` in OpenJDK), matching `CP_GBK` (`936`) and `CP_MS949` (`949`).
   
   If convenient, please also consider backporting this fix to the `5.5.x` 
branch.
   
   ### Testing
   
   - Added `TestCodePageUtil#testWindows932UsesWindows31j` and 
`TestCodePageUtil#testWindows950UsesWindows950` *(note: `TestCodePageUtil` is 
also introduced in #1517; happy to rebase whichever merges second)*.
   - Verified HPSF property reading and writing (`TestShiftJIS.doc` and 
`TestChineseProperties.doc`).
   
   Closes #1514
   
   *Disclosure: Developed with assistance from Google Gemini (`Generated-by: 
Google Gemini`); reviewed and verified by the author.*
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to