Scripting-Error on UTF-8 coded files.

Things you’d like to miss in the future...
Post Reply
PeterH
Posts: 2811
Joined: 21 Nov 2005 20:39
Location: Germany

Scripting-Error on UTF-8 coded files.

Post 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
Attachments
$T_UTF8i.xyi
Include
(216 Bytes) Downloaded 40 times
$T_UTF8.xys
Main Script
(321 Bytes) Downloaded 33 times
Win11 Pro 23H2 Gerrman

admin
Site Admin
Posts: 63451
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

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

Post by admin »

Yep! Fix comes. :tup:

PeterH
Posts: 2811
Joined: 21 Nov 2005 20:39
Location: Germany

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

Post 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: )
Win11 Pro 23H2 Gerrman

admin
Site Admin
Posts: 63451
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

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

Post by admin »

Yes, the include.

PeterH
Posts: 2811
Joined: 21 Nov 2005 20:39
Location: Germany

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

Post by PeterH »

Solved!
Thanks again for fast reaction!
Win11 Pro 23H2 Gerrman

admin
Site Admin
Posts: 63451
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

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

Post 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.

PeterH
Posts: 2811
Joined: 21 Nov 2005 20:39
Location: Germany

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

Post 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:
Win11 Pro 23H2 Gerrman

admin
Site Admin
Posts: 63451
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

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

Post by admin »

Well, I have a tip: Clean it. If that does not help: Get a new one. :)

PeterH
Posts: 2811
Joined: 21 Nov 2005 20:39
Location: Germany

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

Post 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:
Win11 Pro 23H2 Gerrman

Post Reply