[Bf-committers] International Input

Yaohua Xiong xiongyaohua at gmail.com
Thu Apr 22 02:18:33 CEST 2010


Hi,

After looking into Blender code for a while, Here is my current
understanding for the unicode support situation in Blender. I'm still
very in experience to the Blender codebase, so if there is any
mistake, feel free to correct me, thank you!

1. Although Blender doesn't take unicode support into account from
beginning, most of it's string handling need not be modified for they
just treat the string as a list of bytes.

2. The font rendering infrastructure(BLI_Font) support utf8. Good
news, but it also means every character needs to be translated into
utf8.

3. The file operation infrastructure(BLI_fileops) use ANSI version of
Win32 api on windows, I think that's where the problem is currently.
As far as I know, most current OS(WinXP+, linux, Mac) store filenames
in unicode internally, but if your access them from an ANSI api, then
it will return the filename in an multi-byte localize encoding(In my
situation it's GBK for Simplified Chinese). Blender currently have no
way to tell what encoding the file name is in, and couldn't translate
it into utf8 and couldn't render it correctly. I'm not sure about the
situation on linux and mac, but I think it should be the same.

So, what I propose to do is
1. use platform specific unicode version of file operation API in the
implementation of BLI_fileops and encode the (probably) wchar
filename into utf8.
2. OR add a platform independent mechanism to determine the locales,
and translate the relevant BLI_fileops results from local encoding
into utf8.

What do you think, guys?



-- 
Yaohua Xiong

Traffic and Transportation Engineering College, Tongji Univ.
Cao An Road 4800#, Jia Ding District, Shanghai,  China


More information about the Bf-committers mailing list