PLCControler.py
changeset 629 ddf363817ffa
parent 625 b7062a7018ec
child 630 9d7e38e271cb
equal deleted inserted replaced
628:edcd40605fff 629:ddf363817ffa
   619     def PastePou(self, pou_type, pou_xml):
   619     def PastePou(self, pou_type, pou_xml):
   620         '''
   620         '''
   621         Adds the POU defined by 'pou_xml' to the current project with type 'pou_type'
   621         Adds the POU defined by 'pou_xml' to the current project with type 'pou_type'
   622         '''
   622         '''
   623         try:
   623         try:
   624             tree = minidom.parseString(pou_xml)
   624             tree = minidom.parseString(pou_xml.encode("utf-8"))
   625             root = tree.childNodes[0]
   625             root = tree.childNodes[0]
   626         except:
   626         except:
   627             return _("Couldn't paste non-POU object.")
   627             return _("Couldn't paste non-POU object.")
   628 
   628 
   629         if root.nodeName == "pou":
   629         if root.nodeName == "pou":