View Single Post
Old 03-30-2021, 01:42 PM   #1
Meo-Ada Mespotine
Human being with feelings
Meo-Ada Mespotine's Avatar
Join Date: May 2017
Location: Leipzig
Posts: 5,382
Default Weird error-message with dofile, bytecode-lua-files and umlauts in resourcepath

I found a very odd and strange bug, that occurs only on Windows and makes Ultraschall-API sometimes not working.

When I run a script using dofile, it usually loads and executes the script. This script can also be in bytecode, which loads the script slightly faster.

Now here's the thing: it only works, if the path of the resource-folder has no Umlauts(,,) in them. So if you try the same in a portable Reaper-installation "Ultraschall-US_API_4.1.001Bjrn", only the source-code-version will be loaded, while the byte-code-version produces an obscure error, that "can not reopen $scriptfilename".

I made three scripts, that demonstrate this. Just put them into scripts-folder and run the script "ByteCode-Problem.lua".
In a Reaper-installation that doesn't contain an umlaut in the path to the resource-folder, it will show twice the resourcepath.
In Reaper-installations with , or in their resource-path, the script will fail.
(I left some additional comments in the script, just in case.)

I guess, Lua doesn't resolve Unicode-paths properly for dofile, when using bytecode, but it's just a guess.
I haven't tested load or require, but I imagine, that they can have the same problem...

Tested on Reaper 6.26rc3x64 on Windows, but has been reported to be a problem on Reaper 6.25x64(also Windows) too.

Mac and Linux seem to work fine...
Use you/she/her.Ultraschall-Api Lua Api4Reaper
Bugreports&Docs notes please do here: - Donate, if you wish
Meo-Ada Mespotine is offline   Reply With Quote