Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Ultimaker/Cura.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordaid <daid303@gmail.com>2012-04-04 13:10:08 +0400
committerdaid <daid303@gmail.com>2012-04-04 13:10:08 +0400
commitb7701af448f676f049fbccf80c5cc5597fb7a93f (patch)
tree8da25791e560c91c2a59f56d0956718f21f5e935
parent96d014b2c4cef94dbbe4c3adc1c8d7a8ce929ad2 (diff)
Use utf-8 to save preferences, so the last filename may contain unicode characters.
-rw-r--r--Cura/util/profile.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Cura/util/profile.py b/Cura/util/profile.py
index 5845e14cc3..213c57a519 100644
--- a/Cura/util/profile.py
+++ b/Cura/util/profile.py
@@ -158,7 +158,7 @@ def getPreference(name):
globalPreferenceParser.set('preference', name, str(default))
print name + " not found in preferences, so using default: " + str(default)
return default
- return globalPreferenceParser.get('preference', name)
+ return unicode(globalPreferenceParser.get('preference', name), "utf-8")
def putPreference(name, value):
#Check if we have a configuration file loaded, else load the default.
@@ -168,7 +168,7 @@ def putPreference(name, value):
globalPreferenceParser.read(getPreferencePath())
if not globalPreferenceParser.has_section('preference'):
globalPreferenceParser.add_section('preference')
- globalPreferenceParser.set('preference', name, str(value))
+ globalPreferenceParser.set('preference', name, str(value).encode("utf-8"))
globalPreferenceParser.write(open(getPreferencePath(), 'w'))
#########################################################