Handle non-Ascii in ShapeString SStringValue
This commit is contained in:
parent
8de258dded
commit
0f9001a3f5
|
@ -63,7 +63,7 @@ class todo:
|
|||
todo.itinerary = []
|
||||
if todo.commitlist:
|
||||
for name,func in todo.commitlist:
|
||||
# print "debug: committing ",str(name)
|
||||
#print "debug: committing ",str(name)
|
||||
try:
|
||||
name = str(name)
|
||||
FreeCAD.ActiveDocument.openTransaction(name)
|
||||
|
@ -1026,7 +1026,8 @@ class DraftToolBar:
|
|||
if (self.labelSString.isVisible()):
|
||||
if self.SStringValue.text():
|
||||
# print "debug: D_G DraftToolBar.validateSString type(SStringValue.text): " str(type(self.SStringValue.text))
|
||||
self.sourceCmd.validSString(str(self.SStringValue.text())) # QString to QByteArray to PyString
|
||||
#self.sourceCmd.validSString(str(self.SStringValue.text())) # QString to QByteArray to PyString
|
||||
self.sourceCmd.validSString(self.SStringValue.text()) # PySide returns Unicode from QString
|
||||
else:
|
||||
FreeCAD.Console.PrintMessage(translate("draft", "Please enter a text string."))
|
||||
|
||||
|
|
|
@ -1838,16 +1838,12 @@ class ShapeString(Creator):
|
|||
def createObject(self):
|
||||
"creates object in the current doc"
|
||||
#print "debug: D_T ShapeString.createObject type(self.SString): " str(type(self.SString))
|
||||
# temporary code
|
||||
#import platform
|
||||
#if not (platform.system() == 'Linux'):
|
||||
# FreeCAD.Console.PrintWarning("Sorry, ShapeString is not yet fully implemented for your platform.\n")
|
||||
# self.finish()
|
||||
# return
|
||||
# temporary code
|
||||
|
||||
dquote = '"'
|
||||
String = dquote + self.SString + dquote
|
||||
if type(self.SString) == unicode:
|
||||
String = 'u' + dquote + self.SString.encode('unicode_escape') + dquote
|
||||
else:
|
||||
String = dquote + self.SString + dquote
|
||||
Size = str(self.SSSize) # numbers are ascii so this should always work
|
||||
Tracking = str(self.SSTrack) # numbers are ascii so this should always work
|
||||
FFile = dquote + self.FFile + dquote
|
||||
|
|
Loading…
Reference in New Issue
Block a user