Encode / Decode / Unicode ?
Helper last edited by
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 15/02/2011 at 07:05, xxxxxxxx wrote:
I still try to finish my texturereplacementscript which works pretty nice on the R12 with a little exception.
Here is the tricky part of what I have so far:
if shd.GetType() == c4d.Xbitmap:
print "old----------->", shd[c4d.BITMAPSHADER_FILENAME]
file = os.path.basename(shd[c4d.BITMAPSHADER_FILENAME])
print "File--------->", File
shd[c4d.BITMAPSHADER_FILENAME] = path + os.sep + file
print "New Path---->", shd[c4d.BITMAPSHADER_FILENAME]
As said it works nicely, if the filenames are "normal" means that there are no mutated vowels (umlaut) or other non-ascii-conform characters in the filename.
If so( filename: 9Tür.jpg e.g.) the console shows me something like that:
File ---> u00FCr.jpg
New path ---> T:\python est\9Tür.jpg
If I could only trust the print statement ...
In C4D the replaced path is : T:\python est\u00FCr.jpg
The problem is that the last "" (which determines the end of a directory path) is not the one it should be.
The last "" is in front of the non-ascii character : "\u00FCr.jpg"
That is the reason why I can't use split path for that.
I also tried newpath.encode("UTF-8")
but without any noticable effect.
Can anyone give me a hint how to deal with that please?