What's wrong with Chinese support on JUCE 2.0.36?


#1

I know for unaccountable reason,whatever u put Chinese text on Introjucer code editor(juce 2.0) , for example :

/** 这是一个类*/
class a{};

Introjucer will always change the chinese text to “□□□□□□” or “$#^%&^%*&%(&%#” ,and the following text(Even if it is english text)will be:

/** %$&^%*& 
c#$^%$#a a$#;

thats ok, because I can still save the project and open it in VS or xcode . then the chinese text becomes normal.
but I downloaded juce 2.0.36 ,and compile the new Introjucer .new GUI looks beautiful.
BUT I open a project(with some .h and .cpp which have some chinese annotation) and bad things happened.
when I save the project using new Introjucer,these .h and .cpp which have chinese text are really save to “%^#%#^%” !!!
where is my code!!! If not I have dropbox, I think I should direct jump off a building…

and , I found that Before juce 2.0.36 , I can found chinese fonts on FontsAndTextDemo . but when I compile the jucedemo using juce 2.0.36,
the chinese fonts are just disappeared. juce completely abandon support for foreign language??? :frowning:
This is intentional ? or a bug ? or is there are a new function called “void juce::SetSupportForeignLanguage(true)”???


#2

TBH I’ve never tried editing non-ascii text in the CodeEditorComponent, but all strings in juce are unicode, so am surprised there was a problem… Was your input file definitely encoded in utf-8?


#3

Thank you for your reply!
On second question: I think I made a mistake. its not all chinese fonts are “disappeared”,but they change their name to english… :?

juceDemo 2.0:

[attachment=1]text2demo.jpg[/attachment]

juceDemo 2.0.36 :

[attachment=0]text3demo.jpg[/attachment]

so … font for example named “华文” is change to “huawen”… This is intentional?

But about new Introjucer ,Im sure my code file was encoded in utf-8… I have met this situation in some other text editor ,
Sometimes a text editor will try save a text by always use ASCII ,but the text to be saved may using utf-8. :slight_smile:

can you please check this ? I can coding in English, but as you can see, it’s hard for me to write all comments in English… :oops:


#4

Assuming that you’re using Windows, the newer version uses DirectWrite for font support, you could try playing with the JUCE_USE_DIRECTWRITE flag, although I’m not sure exactly what’s going on there.

I just tried copying some chinese text, pasting it into the introjucer, then saving the file, closing it, re-loading it, copying the text and then pasting it back into another editor. Although the introjucer didn’t display the chinese text correctly, it did correctly save and re-load it, so that when I pasted it back into my other editor, the original text came out correctly… So if it got garbled for you, then I can only assume that you tried loading a file that wasn’t utf-8.


#5

[quote=“jules”]Assuming that you’re using Windows, the newer version uses DirectWrite for font support, you could try playing with the JUCE_USE_DIRECTWRITE flag, although I’m not sure exactly what’s going on there.

I just tried copying some chinese text, pasting it into the introjucer, then saving the file, closing it, re-loading it, copying the text and then pasting it back into another editor. Although the introjucer didn’t display the chinese text correctly, it did correctly save and re-load it, so that when I pasted it back into my other editor, the original text came out correctly… So if it got garbled for you, then I can only assume that you tried loading a file that wasn’t utf-8.[/quote]

thinks :smiley: last week I was sick so I didn’t check where I did wrong.
but today I reproduce the error… you can try copying some chinese text, pasting it into the introjucer,
THEN PUT ANY TEXT ON THIS FILE,like a space key or just “A” char and save, the chinese text will be “Alien words” when you open this file next time…

by the way boss,about :

well… can you make chinese text display correctly In the future you are not busy? please…


#6

Yes, if I’m ever not busy (!!) I’ll do that!