[Bf-committers] International Input

Diego B bdiego at gmail.com
Thu Apr 22 05:08:46 CEST 2010


Hello:

On Wed, Apr 21, 2010 at 9:18 PM, Yaohua Xiong <xiongyaohua at gmail.com> wrote:

> 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.
>
> In general, the user set the locale or the program get it from some
environment variable.

Blender already support this, so maybe what we need to do is change the
locale and convert the string to utf8 and see what happen then.. right now
blender only init the lang subsystem.

The problem is that when I move this code from 2.4x to the new blenfont, I
don't really make any change, it's the same old code, so maybe work or
maybe not (if you want to look, it's
source/blender/blenfont/intern/blf_lang.c).


> What do you think, guys?
>
>
>
> --
> Yaohua Xiong
>
> Traffic and Transportation Engineering College, Tongji Univ.
> Cao An Road 4800#, Jia Ding District, Shanghai,  China
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at blender.org
> http://lists.blender.org/mailman/listinfo/bf-committers
>


More information about the Bf-committers mailing list