Repository navigation
CodePageUtil: map Windows code pages 932 and 950 to Microsoft charsets - #1518
Merged
Merged
Conversation
Map CP_SJIS (932) to MS932 / windows-31j instead of strict JIS X 0208 Shift_JIS, and map code page 950 to MS950 / x-windows-950 instead of falling through to "cp950" (which resolves to IBM's x-IBM950 in Java). CP_MAC_JAPAN (10001) continues to return "SJIS". Closes apache#1514 Generated-by: Google Gemini
nikhil1511
force-pushed
the
codepage-932-950
branch
from
November 1, 2026 12:35
04472f7 to
9be7164
Compare
Member
|
There are no plans for 5.x releases. I'll review this later and merge to trunk if it's a valid approach. Only critical issues would be considered for a back port. |
CodePageUtil.codepageToEncoding(950, true) now returns MS950 (Microsoft's Big5 variant) instead of cp950, so the encoding guessed for chinese-traditional.msg changes accordingly.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Updates
CodePageUtil.codepageToEncodingso Windows code pages932(CP_SJIS) and950map to Microsoft's charset tables rather than strict JISShift_JISand IBMx-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 forx-IBM950in OpenJDK), matchingCP_GBK(936) andCP_MS949(949).If convenient, please also consider backporting this fix to the
5.5.xbranch.Testing
TestShiftJIS.docandTestChineseProperties.doc).Closes #1514
Disclosure: Developed with assistance from Google Gemini (
Generated-by: Google Gemini); reviewed and verified by the author.