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
Scripting-Error on UTF-8 coded files.
Scripting-Error on UTF-8 coded files.
- Attachments
-
$T_UTF8i.xyi
- Include
- (216 Bytes) Downloaded 40 times
-
$T_UTF8.xys
- Main Script
- (321 Bytes) Downloaded 33 times
Win11 Pro 23H2 Gerrman
Re: Scripting-Error on UTF-8 coded files.
Fine
Did drrive me crazy, as I first searched for a prroblem with the editor
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
)


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

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

Win11 Pro 23H2 Gerrman
Re: [solved] Scripting-Error on UTF-8 coded files.
Solved!
Thanks again for fast reaction!
Thanks again for fast reaction!
Win11 Pro 23H2 Gerrman
-
- 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.
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.
FAQ | XY News RSS | XY Bluesky
Re: Scripting-Error on UTF-8 coded files.



Though I have no (immediate) need for this, it's fine that you killed another

And also fine that it helps yourself

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

Win11 Pro 23H2 Gerrman
-
- 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.
Well, I have a tip: Clean it. If that does not help: Get a new one. 

FAQ | XY News RSS | XY Bluesky
Re: Scripting-Error on UTF-8 coded files.
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
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

Win11 Pro 23H2 Gerrman