Garbled text

I want to display the Japanese that MSG holds, but how on earth can I do that…?
I am very frustrated with JUCE because I can’t achieve just this.

As you can see in the image, I have already specified the font.

If I write juce::CharPointer_UTF8 (“\xe3\x81\x82\xe3\x81\x84\xe3\x81\x86\xe3\x81\x88\xe3\x81\x8a”) I can achieve my goal once.

However, I would like to display the words that MSG holds and switch between them at any given time.

I would be glad if you could suggest some good ideas.


use TextLayout not drawText

Thanks for the suggestion.

I tried using TextLayout, but juce_String.cpp opens and does not execute with the following message…
“A breakpoint instruction (__debugbreak() statement or similar call) was executed by NewProject.exe.”

I will investigate further.
If there is a solution, I will accept it.

Please help us to provide useful information to the many juce users who use other languages than English.

You need to init your string using the fromUTF8 helper

Thank you.
I also ended up at the same place.

You need to build your own code to convert to shift-jis → UTF8. I’m having a hard time converting character codes. ( JUCE is not compatible with u8string…)

It’s going to take a while, but I’d like to share it if it goes well.

check for UTF-8 String Literal Helper in the projucer

This is limited to my environment (Windows 10),

I want to use literals → UTF-8 String Literal Helper
String of textEditor → How usable as it is (of course…)

The problem of garbled characters has been solved, regardless of whether the source file encoding is UTF-8 or Shift-JIS.

I have not tested the behavior on Mac or Linux, but I expect it will be about the same.

Thanks otristan for the suggestion!