Page 1 of 2

Better support for non standard characters

Posted: Tue Jan 20, 2015 10:05 am
by Mastiff
I have a problem when I copy actions and stuff: If I copy this action:

Code: Select all

├å├ÿ├à├ª├©├Ñ
the copy will be named:

Code: Select all

├âÔÇá├â╦£├âÔǪ├â┬ª├â┬©├â┬Ñ
Also it would be nice if I could use ├ª├©├Ñ in the variables, but maybe that's a limitation in Python?

Re: Better support for non standard characters

Posted: Tue Jan 20, 2015 12:16 pm
by jonib
Mastiff wrote:I have a problem when I copy actions and stuff: If I copy this action:

Code: Select all

├å├ÿ├à├ª├©├Ñ
the copy will be named:

Code: Select all

├âÔÇá├â╦£├âÔǪ├â┬ª├â┬©├â┬Ñ
Where did you copy from and where did you paste to get that?
Also it would be nice if I could use ├ª├©├Ñ in the variables, but maybe that's a limitation in Python?
Here is the definition of what characters are allowed in a Python variable name.

jonib

Re: Better support for non standard characters

Posted: Tue Jan 20, 2015 12:19 pm
by Mastiff
Like I said it's an action that I copied. The same happens if I copy a full macro. All the actions within that macro that has those characters will have the Norwegian letters messed up.

As for the Python, I was sort of expecting that, thanks.

Re: Better support for non standard characters

Posted: Tue Jan 20, 2015 12:32 pm
by jonib
Mastiff wrote:Like I said it's an action that I copied. The same happens if I copy a full macro. All the actions within that macro that has those characters will have the Norwegian letters messed up.
Looks like the characters don't get properly encoded in the XML when copying, I guess this is more a bug then a feature request.

jonib

Re: Better support for non standard characters

Posted: Tue Jan 20, 2015 12:33 pm
by Mastiff
OK, should I move this?

Re: Better support for non standard characters

Posted: Tue Jan 20, 2015 12:34 pm
by jonib
Mastiff wrote:OK, should I move this?
I moved it already.

jonib

Re: Better support for non standard characters

Posted: Tue Jan 20, 2015 12:38 pm
by Mastiff
Fastest mover in the West? :lol:

Re: Better support for non standard characters

Posted: Tue Jan 20, 2015 6:10 pm
by Pako
I fear, that the author of the program will not want to deal with it.
Is there a volunteer who offers to do it instead of him?
Nobody?
What can be done ...
So try to use attached files, instead of the original.
The file TreeItem.py belongs to the directory ...\EventGhost\eg\Classes,
while the file Cut.py belongs to the directory ...\EventGhost\eg\Classes\UndoHandler.
However, I'm not sure if it will not bring any problems.

Pako

Re: Better support for non standard characters

Posted: Tue Jan 20, 2015 6:22 pm
by Mastiff
Thank you, Pako! It works! It didn't implode either. But it brought something new, this came on startup, before any of the plugins (with a possible exception for RFXtrx) were loaded:

Code: Select all

19:21:04   Error compiling script.
19:21:04   Traceback (most recent call last) (1688):
19:21:04     File "C:\Program Files (x86)\EventGhost\eg\Classes\ActionItem.py", line 121, in SetArguments
19:21:04       self.compiled = self.executable.Compile(*args)
19:21:04     File "C:\Program Files (x86)\EventGhost\plugins\EventGhost\PythonScript.py", line 71, in __init__
19:21:04       self.PrintTraceback()
19:21:04     File "C:\Program Files (x86)\EventGhost\plugins\EventGhost\PythonScript.py", line 97, in PrintTraceback
19:21:04       treeItem.PrintError("Traceback (most recent call last):")
19:21:04   AttributeError: 'NoneType' object has no attribute 'PrintError'

Re: Better support for non standard characters

Posted: Tue Jan 20, 2015 6:25 pm
by jonib
Nice Pako, seems to work at least for Swedish characters. Thanks.

jonib

Re: Better support for non standard characters

Posted: Tue Jan 20, 2015 6:29 pm
by Pako
Mastiff wrote:But it brought something new, this came on startup, before any of the plugins (with a possible exception for RFXtrx) were loaded ...
You have a bug in some action Python Script.
I have no option to fix it remotely.

Pako

Re: Better support for non standard characters

Posted: Tue Jan 20, 2015 8:41 pm
by Mastiff
I'll find it. Weird thing is that there was nothing there the last time I restarted EG, and I hadn't changed anything after that.

Re: Better support for non standard characters

Posted: Tue Jan 20, 2015 9:03 pm
by Mastiff
An old script that hasn't been changed for ages, and haven't given any problems before. Deleted now. Is it possible that it got garbled on the last save? Anyway, thanks a lot for the fix! Any possibility for it to go into the next version?

Re: Better support for non standard characters

Posted: Wed Jan 21, 2015 8:19 am
by Mastiff
Really nice to be able to copy without editing all the ├ª's, ├©'s and ├Ñ's. Thanks again, Pako! But I just discovered that the print command also has problems with this. So this print command:

Code: Select all

print "\nAlarmtemperatur 2 (epost n├Ñr kj├©lerom, kj├©leskap og fryser er for varm):\n%s,"%(eg.globals.Alarmtemperatur2)
gives this result:

Code: Select all

09:14:43      Alarmtemperatur 2 (epost n├â┬Ñr kj├â┬©lerom, kj├â┬©leskap og fryser er for varm):
Is that possible to remedy as well?

Re: Better support for non standard characters

Posted: Wed Jan 21, 2015 9:10 am
by Pako
Mastiff wrote:Any possibility for it to go into the next version?
=> 0.4.1.r1691