python - Encoding of arguments to subprocess.Popen -


The Nautilus file is a python extension for the browser (AAAIIK runs specially on GNU / Linux / UNIX / etc)

I decided to divide an expensive calculation and run it as a sub-process, the result was removed and it was sent back to the pipe. My question relates to the script to arguments because calculation requires path logic and a boolean argument, so I thought I could do it in two ways: in a spicy taple on a pipe Send arguments, or give them on the command line. I found that spicy taple's view is slow compared to just debating, so I went with the sub-prakashi logic approach.

However, I am worried about issues of localization which may arise. At the moment ([sys.exrectable, path_to_script, path.encode ("utf-8"), str (recurse)], stdin = none, in the caller I have:

  in the script:  
  path = unicode (sys.argv [1], "utf-8")  

/ code>

My concern is That way UTF-8 is a mistake as the path logic encoding, but I do not know for sure. I want to avoid "It works on my machine" syndrome. Could it be unsuccessful if a user It is said that Latin 1 is their default character In the form of encoding? Or does it make any difference?

It does not matter: unless your Script encoding for UTF-8, it can decode it properly. UTF-8 is the correct option because it will allow you to convert any unicode string into encode - not just for some languages ​​but for others , Because options like Latin-1 will be required! < / P>


Comments

Popular posts from this blog

MySql variables and php -

c# - How can I find out if there are windows above a control? -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -