Scripting-Error on UTF-8 coded files.

Things you’d like to miss in the future...
Forum rules
:warnred20: :warnred20: :warnred20: :warnred20: :warnred20: READ THIS AND DO IT!!! :warnred20: :warnred20: :warnred20: :warnred20: :warnred20:

:info: Please include the following information:
1) Your XYplorer Version (e.g., v28.00.0801)
2) Your Windows Version (e.g., Win 11)
3) Your Screen Scaling Percentage (e.g., 125%).

:info: We strongly recommend adding your Windows Version and Screen Scaling Percentage to the Location field in your Profile or to your Signature. That way, you only have to type them once, and we won't have to search for that vital information.

:info: When attaching an Image, please use the Attachment tab at the bottom of your post and click "Add files".

:warnred20: :warnred20: :warnred20: :warnred20: :warnred20: READ THIS AND DO IT!!! :warnred20: :warnred20: :warnred20: :warnred20: :warnred20:
Post Reply
PeterH
Posts: 2830
Joined: 21 Nov 2005 20:39
Location: DE W11Pro 24H2, 1920*1200*100% 3840*2160*150%

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
To see the attached files, you need to log into the forum.

admin
Site Admin
Posts: 66583
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: 2830
Joined: 21 Nov 2005 20:39
Location: DE W11Pro 24H2, 1920*1200*100% 3840*2160*150%

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: )

admin
Site Admin
Posts: 66583
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: 2830
Joined: 21 Nov 2005 20:39
Location: DE W11Pro 24H2, 1920*1200*100% 3840*2160*150%

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

Post by PeterH »

Solved!
Thanks again for fast reaction!

admin
Site Admin
Posts: 66583
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: 2830
Joined: 21 Nov 2005 20:39
Location: DE W11Pro 24H2, 1920*1200*100% 3840*2160*150%

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:

admin
Site Admin
Posts: 66583
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: 2830
Joined: 21 Nov 2005 20:39
Location: DE W11Pro 24H2, 1920*1200*100% 3840*2160*150%

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:

Post Reply