[Bf-committers] Proposal for handling string encoding in blender.

Roger Wickes rogerwickes at yahoo.com
Fri Aug 13 20:30:23 CEST 2010

I think that if you save "numéro" in your .blend, it does not matter what the OS 
UTF is;
when you enter it into like the text editor or a field within the Blender UI, 
it only matters what the str function in Blender (that is processing that field) 

does when it is reading that field and saving it. 

I suggest that all string functions in Blender use UTF8 encoding, 
and save strings internally as a UTF8 array,
so that the accent is preserved if you enter it as say, a mesh name.

OS dependency is only relevant when, say, creating a folder or file. For that,
Blender should use OS-defaultencoding as Campbell has said, when dealing with
filenames and the absolutely idiotic slash/backslash conflict we have today. All
OS encodings will respect your "numéro" as a filename/dirname/username, afaik.


----- Original Message ----
From: Elia Sarti <vekoon at gmail.com>
To: bf-blender developers <bf-committers at blender.org>
Sent: Fri, August 13, 2010 6:47:01 AM
Subject: Re: [Bf-committers] Proposal for handling string encoding in blender.

The point is that different systems use different encodings. UTF-8 is 
just one way to encode multibyte characters, UTF-16 is another for 
instance (and there are hundreds others).

Means if you save "numéro" in your .blend on an OS using utf-8 and 
someone opens it in one using utf-16 then the string is incompatible.

I say +1 to this with an addendum.
To some extent encoding can be detected and thus converted, would it be 
hard to do so for strings in the .blend? Of course only for a limited 
collection, I'd say utf-8 <-> utf-16 would probably suffice as I believe 
many linux distros use utf-8 while windows and mac use utf-16, so this 
would cover the majority of cases.


More information about the Bf-committers mailing list