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.
Forum rules
READ THIS AND DO IT!!!
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%).
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.
When attaching an Image, please use the Attachment tab at the bottom of your post and click "Add files".
READ THIS AND DO IT!!!
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%).
-
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.
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:
-
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.
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
-
admin
- Site Admin
- Posts: 66583
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
-
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.
Solved!
Thanks again for fast reaction!
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.
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 X
-
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.
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
-
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.
Well, I have a tip: Clean it. If that does not help: Get a new one. 
FAQ | XY News RSS | XY X
-
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.
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
XYplorer Beta Club