What can I do in order to make opencascade support chinese file path?
Opencascade can not open file under chinese file path now .
Marko Knöbl
2013/03/07 13:43
I had this problem too. In order to work around it in my application I'm creating a temporary directory, then copying the file to that temporary directory and reading it from there.
On Linux I get a file path that looks like this: "/var/my-application-name/import-file.stp" - so it only contains ASCII characters and can be read without any problem.
Note that this workaround will not help if the users are running Windows and have non-ASCII-characters in their username as the temporary path there will be "C:\Users\USERNAME\AppData\Local\Temp\my-application-name".
Hope this helps!
Göran Barz
2013/03/11 11:23
If you use Windows, you might try to use the short path name, which if I remember correctly only consists of ascii letters:
Thanks for your help! I have tried you method but it also can not read chinese file path.
I checked opencascade's source file and found that it is the type OSD_Path that can not surpport
chinese characters. Because chinese character is multi-bytes and opencascade read file path with Standard_Character,So it can not read chinese character. I need change opencascade's code if I want
improve the problem.
SunHongLei
2013/03/12 14:55
It can be setteled by this way : in the file OSD_Path.cxx there is a function named systemname, change the code
for ( i = j = 1; i <= myTrek.UsefullLength() && j <= _MAX_PATH; ++i, ++j )
to
for ( i = j = 1; i <= myTrek.Length() && j <= _MAX_PATH; ++i, ++j )