[Maya] P4python reading chinese path

I am now working on a Maya assets browser which connect to perforce and do some perforce work.
However, every time when I want to check my file status like this:

…some codes here…

for s in self._siblings:
Rname = s
Rpath = os.path.join(self._rootPath, s)
Rpath1 = unicode(Rpath)
print Rpath1, " ", type(Rpath1)
try:
print self.parent.p4Client.p4.run(“fstat”, Rpath1)
except:
pass

… some codes here…

and if my file path contains Chinese, it will crash Maya
I have checked my Path and it can shows Chinese in maya scripter
and it only crashes when the path has Chinese


https://drive.google.com/file/d/0B3MaT7nR_BQWcnA3STQ1Y1h5VFU/view?usp=sharing

Any ideas how can I fix this??

Thanks >"<

I don’t really know the context, but to convert between ascii and unicode you should use .decode(‘utf8’) and .encode(‘utf8’) and not to a type conversion by casting. E.g. NOT myUnicode = unicode(MyString)

I’ve run into issues passing unicode text to certain properties when using p4python, specifically the password property got me locked out of perforce a few times because it demands ascii str/bytes, even if the server is set to have a unicode char set.

Not sure if that is going to cause issues with any of the other commands though.