How to correctly display Chinese folder/filename?
All Chinese words in open/save file dialog are messy codes, it’s a really trouble with me.
You’re seeing odd codes? I see nothing at all…
If I take a folder that displays properly in the “File/Open” window and then add a unicode character to the end (a Chinese character for example) that folder no longer shows up in “File/Open”. The entire folder is just ignored.
I thought that Blender uses FreeType to display text and that library supports unicode. There are also GPL unicode fonts so it should be possible, but does not look like it is just yet…
Does anyone know how to change the UI font in 2.5A1? Do you still have to recompile for this? What font formats does it support?
Harley
I took a bit more time to poke around and I don’t think you should hold your breath waiting for support for Chinese characters in paths.
Although there is some support for unicode strings in the Blender source, it does not look like it handles unicode file names on Windows platforms at least. It would need to use wide strings and use FindFirstFileW instead of the regular FindFirstFile API calls, amongst lots of other changes.
This could certainly be inconvenient if you have a profile name with unicode characters. You might want to make a folder in the root of your drive using only standard roman characters and put your Blender projects in there.
Harley
In general, Blender internally DOES NOT support unicode.
(Personally, I don’t have any use for it either…)
> In general, Blender internally DOES NOT support unicode.
In earlier versions of Blender you could enable “International fonts” in the preferences, then select a unicode font to allow these characters in the UI, but it didn’t support them in file names.
I thought I read that there was unicode support in the OpenCollada lilbraries we are now using, and also in Python.
> (Personally, I don’t have any use for it either…)
I don’t need it either, but it wouldn’t harm either of us if it were supported. But it is pretty obvious how nice it would be for those Blender users who use Chinese, Hindi, Cyrillic, Thai, Arabic, Hebrew, etc. They do make up billions of potential Blender users.
I seems so trivial to just tell people to use roman characters in their file names and paths, but imagine someone telling you could you some cool Chinese-made software but you simply had to use Chinese characters in the file names. You probably wouldn’t use it.
Harley
I guess the best example of this being a problem is someone setting up a brand-new computer today running Vista or Windows 7. The setup process creates your username and it will gladly accept unicode characters. So you can enter your own name and have it look as you want it to, in Chinese characters for example.
Now your desktop is at c:\users[chinese name]\desktop and your “home” folder for documents is c:\users[chinese name]\documents. Later you install Blender and find that it can’t handle loading files in either of these locations because of the unicode characters in the paths.
Again, this doesn’t directly affect me, but it does affect the OP and probably many more.
Harley
Let’s say that I don’t mind that file and path names cannot be displayed in non latin characters. If I know about this in advance then I can prepare for it. What I find to be really annoying is that I cannot use unicode chars in the text object: typing text or importing text does not work. This is a real limitation as it makes it impossible to create 3D text in several languages/scripts.
Does anyone know how to solve this?
Although I haven’t seen how to do this in 2.5, you could in older versions of Blender. In 2.4x just add some text, change the font to one that is unicode (liike ARIALUNI.TTF in your windows “fonts” folder). You can then use the “char” tab to input unicode or you can import it. Here is a thread describing how to do this:
http://blenderartists.org/forum/showthread.php?t=80247&highlight=Japanese
Harley
“Text>Paste File” from within edit mode, works fine for me (Blender v2.5 alpha1).
N30N,
Sorry, do you mind to be a little bit more specific by giving us some practical examples, please? This is a matter about which I am very interested in. I tried to input “Text>Paste File” into the Console and into the Text Editor but it didn’t work. I also created a new file (Text.txt) and put it on c:\Text.txt and tried again with Text>Paste c:\Text.txt, but also this didn’t work. What’s my mistake?
Thanks in Advance,
Benkei
Thank you very much, especially for Harley.
I just want to know does it can be solved now, and it seems can not.
But no problem, though it’s fairly a trouble with me, but it’s not serious, and I hope it can be fixed in the future probably by non-Latin language users or by myself.(if enough long time for me to learn about how to build Blender SVN before it be solved.)
A step-by-step on my system (English-only user on 2.5A1 on XP).
Put some unicode into a text file. I can just launch the windows accessory “Character Map”, select “Arial Unicode MS” as the font, scroll down the list to the Chinese characters and double-click one at random, click “copy” to paste the character to the clipboard. Launch notepad, “paste” the Chinese character, the “file/save as” making sure to select a unicode type in the “encoding” dropdown. I normally would select “UTF-8”.
In Blender, shift-a and add a text object. Go to the text panel (looks like a capital “F” and the popup hint says “object data” in error). In the “Font” area click the “open” icon and browse to your system fonts folder (probably a folder called “fonts” in your “windows” directory) and select “ARIALUNI.TTF”. Tab into edit mode. Look to the very bottom/left of the main 3d window and see there are two menus, “view” and “text”. select “text” / “paste file” and select the file you saved earlier. The text onscreen should now contain your special character.
Harley
Harley,
Your step-by-step explanation was very clear. It works perfectly! Thank you.
Basically, it seems to work like in Blender 2.49. The only difference is the position of “Text > Paste File”, which is not so easy to find if you don’t know it in advance.
Benkei
@Harley: thanx for the link, it put me on the right track. I checked it out and came up with a solution. The part I was missing was the new Font panel which appears only when a text object is inserted/selected. In retrospect it makes perfect sense. Strangely enough, no arial unicode font was available on my system. To my surprise, one of the windoze fonts, calibri, was the one that worked with the pasted text. On Debian/Ubuntu linux systems, fonts reside in the /usr/share/fonts dir.