Page 1 of 1

Scripting-Error on UTF-8 coded files.

Posted: 13 Mar 2023 01:28
by PeterH
There's an Error on charset use, if
- you call a function
- from an included file
- that's UTF-8
The text of this function is interpreted as ANSI! That is: non-ASCII-characters, e.g. §, are misinterpreted.
(Both XY-Preview and Editor show: including and included files are UTF-8)
(I include a § in a comment near top of each script file to help XY (and others) to destinguish between ANSI and UTF-8.)

No problem with loaded script from same file, or from a function in the same file as the main-script.

An example of 2 files, 1 * .xys, 1 * .xyi is included, Just start the first - it will show you all:
- by text-output in each situation (always "§ °")
- by contents of variables, as it steps through all stmts

Re: Scripting-Error on UTF-8 coded files.

Posted: 13 Mar 2023 12:02
by admin
Yep! Fix comes. :tup:

Re: Scripting-Error on UTF-8 coded files.

Posted: 13 Mar 2023 12:12
by PeterH
Fine :cup: :om:

Did drrive me crazy, as I first searched for a prroblem with the editor :whistle:

By the way: I think it isn't the function, but the include, isn't it?
(No idea how to call the _Dummy script from the include - nowadays I only use functions :roll: )

Re: Scripting-Error on UTF-8 coded files.

Posted: 13 Mar 2023 12:18
by admin
Yes, the include.

Re: [solved] Scripting-Error on UTF-8 coded files.

Posted: 13 Mar 2023 12:30
by PeterH
Solved!
Thanks again for fast reaction!

Re: Scripting-Error on UTF-8 coded files.

Posted: 13 Mar 2023 13:00
by admin
BTW, your script did not run without adjustments in my test location. So the next beta will have this improvement:

Code: Select all

    + SC load: If the load command is within a loaded script file, you now can omit the 
      path of the loaded file. If will default to the path of the containing script file.
        load "test.xys";
      This is probably a bug fix because it was always meant to be like this. It is 
      perfectly natural and allows you to move the parent script and loaded file together 
      without any adjustments.

Re: Scripting-Error on UTF-8 coded files.

Posted: 13 Mar 2023 23:17
by PeterH
:biggrin: Now I have an idea why I didn't find a way to load the script out of the included file :party: :beer:

Though I have no (immediate) need for this, it's fine that you killed another :bug: .
And also fine that it helps yourself :whistle:
So everybody seems to be happy now
- but not me: my keyboard has a hickup and drives me crazy. I'm afraid you can't help with that :oops:

Re: Scripting-Error on UTF-8 coded files.

Posted: 14 Mar 2023 07:41
by admin
Well, I have a tip: Clean it. If that does not help: Get a new one. :)

Re: Scripting-Error on UTF-8 coded files.

Posted: 14 Mar 2023 11:41
by PeterH
OK OK - you might be right. Again.

Another problem: it's getting dark. At 11:35 (AM).
(Seems this year can't get too dry?)
OK: time for some scripting!

Have a nice day :cup: