[GH-ISSUE #2400] Strange behavior with Japanese dakuten and handakuten characters (examples ギ、パ) #914

Closed
opened 2026-03-17 17:53:40 +03:00 by kerem · 22 comments
Owner

Originally created by @akemin-dayo on GitHub (Jun 22, 2013).
Original GitHub issue: https://github.com/hrydgard/ppsspp/issues/2400

image
image
The UI appears to give the dakuten and handakuten characters their own character space, which is incorrect behavior

Dakuten and Handakuten are the circle and " markings you see on some Japanese characters

Like the " in "gi" -> ギ
Or the circle in "pa" -> パ

To reproduce the problem: put the characters ギ and/or パ in a filename and view it in PPSSPP.

Dakuten and Handakuten display properly in the PPSSPP pause screen.

EDIT: Screenshot attached. 「コードギアス 反逆のルルーシュ LOST COLORS」 is the title.

Originally created by @akemin-dayo on GitHub (Jun 22, 2013). Original GitHub issue: https://github.com/hrydgard/ppsspp/issues/2400 ![image](https://f.cloud.github.com/assets/1980487/690911/6906e262-db4a-11e2-9d52-6db870b3790c.jpg) ![image](https://f.cloud.github.com/assets/1980487/690906/95871470-db49-11e2-880a-6f20d8cddb8e.jpg) The UI appears to give the dakuten and handakuten characters their own character space, which is incorrect behavior Dakuten and Handakuten are the circle and " markings you see on some Japanese characters Like the " in "gi" -> ギ Or the circle in "pa" -> パ To reproduce the problem: put the characters ギ and/or パ in a filename and view it in PPSSPP. Dakuten and Handakuten display properly in the PPSSPP pause screen. EDIT: Screenshot attached. 「コードギアス 反逆のルルーシュ LOST COLORS」 is the title.
Author
Owner

@unknownbrackets commented on GitHub (Jun 22, 2013):

Are these combining characters or something? I wonder if this is related to how they're being encoded specifically in filenames, rather than in the game's sfo.

-[Unknown]

<!-- gh-comment-id:19858227 --> @unknownbrackets commented on GitHub (Jun 22, 2013): Are these combining characters or something? I wonder if this is related to how they're being encoded specifically in filenames, rather than in the game's sfo. -[Unknown]
Author
Owner

@akemin-dayo commented on GitHub (Jun 22, 2013):

They aren't combining characters. At least, they shouldn't.

<!-- gh-comment-id:19858761 --> @akemin-dayo commented on GitHub (Jun 22, 2013): They aren't combining characters. At least, they shouldn't.
Author
Owner

@lioncash commented on GitHub (Jun 25, 2013):

This may have been fixed with my recent commit. If the issue still exists, just tell me and I'll try to fix it.

<!-- gh-comment-id:20010039 --> @lioncash commented on GitHub (Jun 25, 2013): This may have been fixed with my recent commit. If the issue still exists, just tell me and I'll try to fix it.
Author
Owner

@akemin-dayo commented on GitHub (Jul 7, 2013):

No, this issue has not been fixed.

<!-- gh-comment-id:20564209 --> @akemin-dayo commented on GitHub (Jul 7, 2013): No, this issue has not been fixed.
Author
Owner

@lioncash commented on GitHub (Jul 7, 2013):

I'll see what I can do tomorrow

<!-- gh-comment-id:20564916 --> @lioncash commented on GitHub (Jul 7, 2013): I'll see what I can do tomorrow
Author
Owner

@adrian17 commented on GitHub (Aug 27, 2013):

Just an update, the bug is still present with the new UI.

nfjjxvm
pkswks8

<!-- gh-comment-id:23358261 --> @adrian17 commented on GitHub (Aug 27, 2013): Just an update, the bug is still present with the new UI. ![nfjjxvm](https://f.cloud.github.com/assets/4729533/1036842/45459188-0f44-11e3-9580-9e8d8b8d5581.jpg) ![pkswks8](https://f.cloud.github.com/assets/4729533/1036843/457a3762-0f44-11e3-893f-7ff66eab1ad4.jpg)
Author
Owner

@lioncash commented on GitHub (Aug 27, 2013):

I'll try and look into it when I have time (currently working on the UI for the Android version of the Dolphin Emulator). I'll try to find time tonight to get a basic look at what's going on.

<!-- gh-comment-id:23370105 --> @lioncash commented on GitHub (Aug 27, 2013): I'll try and look into it when I have time (currently working on the UI for the Android version of the Dolphin Emulator). I'll try to find time tonight to get a basic look at what's going on.
Author
Owner

@hrydgard commented on GitHub (Aug 27, 2013):

I just tried it and it works fine for me. Weird.

<!-- gh-comment-id:23372102 --> @hrydgard commented on GitHub (Aug 27, 2013): I just tried it and it works fine for me. Weird.
Author
Owner

@adrian17 commented on GitHub (Aug 28, 2013):

I just checked, it works fine on my Android phone too. The screenshots above were from the iPhone 4.

<!-- gh-comment-id:23403200 --> @adrian17 commented on GitHub (Aug 28, 2013): I just checked, it works fine on my Android phone too. The screenshots above were from the iPhone 4.
Author
Owner

@hrydgard commented on GitHub (Aug 28, 2013):

This really shouldn't be different between platforms. Did you use a custom built ui_atlas?

<!-- gh-comment-id:23403725 --> @hrydgard commented on GitHub (Aug 28, 2013): This really shouldn't be different between platforms. Did you use a custom built ui_atlas?
Author
Owner

@adrian17 commented on GitHub (Aug 28, 2013):

I didn't touch it, it happens on a freshly installed Testing build. The file was just cube.elf renamed manually on the phone with iFile.

<!-- gh-comment-id:23404823 --> @adrian17 commented on GitHub (Aug 28, 2013): I didn't touch it, it happens on a freshly installed Testing build. The file was just cube.elf renamed manually on the phone with iFile.
Author
Owner

@thedax commented on GitHub (Aug 28, 2013):

Seems to be fine for me on my PC..that's really weird.

<!-- gh-comment-id:23405833 --> @thedax commented on GitHub (Aug 28, 2013): Seems to be fine for me on my PC..that's really weird.
Author
Owner

@akemin-dayo commented on GitHub (Aug 28, 2013):

For those who are curious as to what @adrian17 means by "Testing build," I have 2 release "channels" running on KarenBuildBot, each updated at different intervals.

The "Testing" channel is simply the one that gets updated after every push, as long build is successful (the new KarenBuildBot will refuse to upload if the build fails)

That being said, I can confirm that this issue still happens. I'm going to attempt a clean build of all KarenBuildBot projects to see if that fixes anything.

EDIT: The clean build did nothing. Oh well, it was worth a try.

<!-- gh-comment-id:23428123 --> @akemin-dayo commented on GitHub (Aug 28, 2013): For those who are curious as to what @adrian17 means by "Testing build," I have 2 release "channels" running on KarenBuildBot, each updated at different intervals. The "Testing" channel is simply the one that gets updated after every push, as long build is successful (the new KarenBuildBot will refuse to upload if the build fails) That being said, I can confirm that this issue still happens. I'm going to attempt a clean build of all KarenBuildBot projects to see if that fixes anything. EDIT: The clean build did nothing. Oh well, it was worth a try.
Author
Owner

@unknownbrackets commented on GitHub (Aug 28, 2013):

What are the bytes of the filename (e.g. from readdir)? It really looks like the filename (perhaps just on iOS) is using combining characters and our font renderer simply isn't combining them.

-[Unknown]

<!-- gh-comment-id:23448486 --> @unknownbrackets commented on GitHub (Aug 28, 2013): What are the bytes of the filename (e.g. from readdir)? It really looks like the filename (perhaps just on iOS) is using combining characters and our font renderer simply isn't combining them. -[Unknown]
Author
Owner

@unknownbrackets commented on GitHub (Sep 2, 2013):

So, I confirmed that this can be a combining character. For example, here:

゙ ゚

Those are combining characters. Here's some regular characters:

キ ヘ

And here's them next to each other, compared to a regular character with the mark:

ヘ ゚ ペ

In some cases, inputs will auto combine these characters I think? I don't really know the rules well, but I do know that in Japanese these are typically only used as combining characters with half-width kana, since the character set doesn't include these marks for half-width glyphs.

Here's half vs full:
ヘ ヘ

And with the mark vs full with the mark:

ヘ ゚ ペ

I suspect that for whatever reason, your filename contains combining characters, while the game title (included in PARAM.SFO) showing in the pause screen does not.

-[Unknown]

<!-- gh-comment-id:23642105 --> @unknownbrackets commented on GitHub (Sep 2, 2013): So, I confirmed that this _can_ be a combining character. For example, here: ゙ ゚ Those are combining characters. Here's some regular characters: キ ヘ And here's them next to each other, compared to a regular character with the mark: ヘ ゚ ペ In some cases, inputs will auto combine these characters I think? I don't really know the rules well, but I do know that in Japanese these are typically only used as combining characters with half-width kana, since the character set doesn't include these marks for half-width glyphs. Here's half vs full: ヘ ヘ And with the mark vs full with the mark: ヘ ゚ ペ I _suspect_ that for whatever reason, your filename contains combining characters, while the game title (included in PARAM.SFO) showing in the pause screen does not. -[Unknown]
Author
Owner

@xsacha commented on GitHub (Nov 25, 2013):

So the naming method that iFile (in iOS) uses isn't compatible with our font atlas.
I think this can only be resolved by rendering with native fonts, right? Eg. what is currently done in Windows and Qt.

<!-- gh-comment-id:29174992 --> @xsacha commented on GitHub (Nov 25, 2013): So the naming method that iFile (in iOS) uses isn't compatible with our font atlas. I think this can only be resolved by rendering with native fonts, right? Eg. what is currently done in Windows and Qt.
Author
Owner

@hrydgard commented on GitHub (May 15, 2014):

@angelXwind is this no longer an issue? When closing after a long time, it's good if you post a short message stating that it's fixed or some other reason why the issue should be closed.

<!-- gh-comment-id:43206016 --> @hrydgard commented on GitHub (May 15, 2014): @angelXwind is this no longer an issue? When closing after a long time, it's good if you post a short message stating that it's fixed or some other reason why the issue should be closed.
Author
Owner

@akemin-dayo commented on GitHub (May 15, 2014):

Sorry about that, accidentally hit the close button on this one, tried to stop it, and mobile Chrome ended up crashing.

<!-- gh-comment-id:43207974 --> @akemin-dayo commented on GitHub (May 15, 2014): Sorry about that, accidentally hit the close button on this one, tried to stop it, and mobile Chrome ended up crashing.
Author
Owner

@akemin-dayo commented on GitHub (May 15, 2014):

Also, @xsacha: iFile is a third-party application... I'm sure that's not the cause here.

Perhaps you were trying to refer to CoreText or something similar?

Renaming the file using mv still produces the same bug, so I don't think it's something wrong with the filesystem (which is HFS+, same as OS X)

<!-- gh-comment-id:43265936 --> @akemin-dayo commented on GitHub (May 15, 2014): Also, @xsacha: iFile is a third-party application... I'm sure that's not the cause here. Perhaps you were trying to refer to CoreText or something similar? Renaming the file using `mv` still produces the same bug, so I don't think it's something wrong with the filesystem (which is HFS+, same as OS X)
Author
Owner

@unknownbrackets commented on GitHub (May 15, 2014):

http://stackoverflow.com/questions/9757843/unicode-encoding-for-filesystem-in-mac-os-x-not-correct-in-python
"MacOS X uses a special kind of decomposed UTF-8 to store filenames." "In particular, the HFS+ filesystem uses UTF-8 encoding, and normalisation form D (which requires composed characters like ö to be decomposed into o¨)."

So they most likely are indeed decomposed characters.

I'm not saying this is wrong, but our font routine currently doesn't handle decomposed characters well. We could either:

  • Use FreeType / similar like on Windows to render extents of text.
  • Pre-normalize the unicode code points to get rid of the decomposed characters.
  • Handle decomposed characters better during rendering.

-[Unknown]

<!-- gh-comment-id:43268331 --> @unknownbrackets commented on GitHub (May 15, 2014): http://stackoverflow.com/questions/9757843/unicode-encoding-for-filesystem-in-mac-os-x-not-correct-in-python "MacOS X uses a special kind of decomposed UTF-8 to store filenames." "In particular, the HFS+ filesystem uses UTF-8 encoding, and normalisation form D (which requires composed characters like ö to be decomposed into o¨)." So they most likely are indeed decomposed characters. I'm not saying this is wrong, but our font routine currently doesn't handle decomposed characters well. We could either: - Use FreeType / similar like on Windows to render extents of text. - Pre-normalize the unicode code points to get rid of the decomposed characters. - Handle decomposed characters better during rendering. -[Unknown]
Author
Owner

@xsacha commented on GitHub (Jul 1, 2014):

@angelXwind For now you can use the Qt build (which won't have this issue) to get correct fonts.
It should build fine in iOS and Mac OSX (otherwise send me the error).

Long-term, we'll need to use one of the solutions suggested by @unknownbrackets
This glitch does happen in OSX as well, right?

<!-- gh-comment-id:47630954 --> @xsacha commented on GitHub (Jul 1, 2014): @angelXwind For now you can use the Qt build (which won't have this issue) to get correct fonts. It should build fine in iOS and Mac OSX (otherwise send me the error). Long-term, we'll need to use one of the solutions suggested by @unknownbrackets This glitch does happen in OSX as well, right?
Author
Owner

@unknownbrackets commented on GitHub (Apr 11, 2020):

Going to close this as a duplicate of #9958. As mentioned by xsacha, Qt, Windows, and Android should now render this right using native font rendering.

-[Unknown]

<!-- gh-comment-id:612527717 --> @unknownbrackets commented on GitHub (Apr 11, 2020): Going to close this as a duplicate of #9958. As mentioned by xsacha, Qt, Windows, and Android should now render this right using native font rendering. -[Unknown]
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ppsspp#914
No description provided.