43 # set the language for the process |
42 # set the language for the process |
44 if language: |
43 if language: |
45 env.insert("LANGUAGE", language) |
44 env.insert("LANGUAGE", language) |
46 |
45 |
47 proc.setProcessEnvironment(env) |
46 proc.setProcessEnvironment(env) |
48 |
|
49 |
|
50 try: |
|
51 from Globals import strToQByteArray |
|
52 except ImportError: |
|
53 def strToQByteArray(txt): |
|
54 """ |
|
55 Module function to convert a Python string into a QByteArray. |
|
56 |
|
57 @param txt Python string to be converted |
|
58 @type str, bytes, bytearray, unicode |
|
59 """ |
|
60 if sys.version_info[0] == 2: |
|
61 if isinstance(txt, unicode): # __IGNORE_WARNING__ |
|
62 txt = txt.encode("utf-8") |
|
63 else: |
|
64 if isinstance(txt, str): |
|
65 txt = txt.encode("utf-8") |
|
66 |
|
67 return QByteArray(txt) |
|