AIMP Forum

AIMP for Android => Ошибки и замечания / Bugs => Topic started by: Tama on July 16, 2026, 20:52:23

Title: Shift-JIS tag encoding is still incomplete / garbled (Ref: Task #1565)
Post by: Tama on July 16, 2026, 20:52:23
Hello,

Regarding the Shift-JIS support implemented in Task #1565 (previously discussed in topic #74667, which is now inaccessible), some specific Japanese characters still get severely garbled in the latest version (v4.31.1740).

[Problem Description]
When reading tags encoded in Shift-JIS (CP932), characters whose second byte falls into specific ranges (such as 0x5C, 0x5B, 0x40, 0x5F, 0x5D) are incorrectly parsed or escaped by the player. This causes specific characters to turn into ASCII symbols, brackets, or disappear entirely.

[Examples of Garbled Text]

1. Issue with 2nd-byte 0x5B (parsed as "[") and 0x5C (parsed as "\")
- Correct: だってアタシのヒーロー。
- Actual: だってア�^シのヒ�[ロ�[。
  *(Note: "タ" (0x82 0x5C) turns into "^" or is escaped, "ー" (0x81 0x5B) turns into "[")*

- Correct: オーバーテイク!
- Actual: オ�[バ�[テイク!
  *(Note: "ー" (0x81 0x5B) turns into "[")*

2. Issue with 2nd-byte 0x40 (parsed as "@")
- Correct: 魔法のフラッシュ
- Actual: 魔�@のフラッシュ
  *(Note: "法" (0x96 0x40) turns into "@")*

3. Issue with 2nd-byte 0x5F (parsed as "_") and 0x5D (parsed as "]")
- Correct: エルダの江戸講座
- Actual: エル�_の�]戸講座
  *(Note: "ダ" (0x83 0x5F) turns into "_", "江" (0x8C 0x5D) turns into "]")*


[Steps to Reproduce]
1. Play the attached stream or file with Shift-JIS (CP932) encoded tags.
2. Observe the track title/artist name in the playlist.

[Environment]
- AIMP for Android: v4.31.1740 (and latest builds)
- OS: Android 16
- Device: Xperia 1 VII

I have attached screenshots showing the issue (and a sample file if applicable).
Since this is a systematic encoding issue regarding the 2nd-byte evaluation of CP932, could you please reopen this task and review the parser's character escaping logic?

Thank you for your continuous support.
Title: Re: Shift-JIS tag encoding is still incomplete / garbled (Ref: Task #1565)
Post by: Artem on July 17, 2026, 10:15:12
AIMP uses built-in to Android Shift-JIS support, I cannot fix that on my side.
Title: Re: Shift-JIS tag encoding is still incomplete / garbled (Ref: Task #1565)
Post by: Tama on July 17, 2026, 23:27:11
Thank you for your reply.

However, I believe this is not an issue with the Android OS itself, but rather a misinterpretation or incorrect encoding assignment within AIMP when parsing non-Unicode streams.

Specifically, it appears that AIMP is mistakenly treating the Shift-JIS (CP932) stream as "ISO-8859-1" (Western European) before passing it to the OS decoder. Because of this, the 2-byte Japanese characters are being split and parsed single-byte by single-byte as ASCII/ISO-8859-1 characters.

This is strongly proven by the exact pattern of the garbled characters I provided:

1. "ー" (0x81 0x5B in Shift-JIS)
   - 0x5B is the ASCII code for "[". AIMP displays it as "[".
2. "法" (0x96 0x40 in Shift-JIS)
   - 0x40 is the ASCII code for "@". AIMP displays it as "@".
3. "ダ" (0x83 0x5F in Shift-JIS)
   - 0x5F is the ASCII code for "_". AIMP displays it as "_".
4. "江" (0x8C 0x5D in Shift-JIS)
   - 0x5D is the ASCII code for "]". AIMP displays it as "]".
5. "タ" (0x82 0x5C) and "ン" (0x83 0x5C)
   - 0x5C is parsed as "\" (the escape character in ASCII/ISO-8859-1), causing the text to truncate.

If the Android OS's Shift-JIS decoder were genuinely broken, it would not cleanly expose these exact 2nd-byte ASCII characters. This clean exposure only happens because AIMP tells the OS to decode the stream as ISO-8859-1, or fails to explicitly pass the "CP932/Shift-JIS" charset parameter to the Android API for this stream type.

Could you please double-check if AIMP is forcing ISO-8859-1 on these metadata fields, or if it can be allowed to fall back to the system locale / explicit CP932 when non-Unicode metadata is detected?

Thank you for your time and for reconsidering this issue.