[Windows] [Lime 7.9.0] FileReference.data returns null when selecting file from a directory with non-Latin characters in the name, with a workaround

A Greek player experienced consistent crashes in our game after selecting a file to load from a prompt.

They moved the file to a directory with only Latin characters in the name and was able to successfully load the file that way.

I tested and found that calling FileReference.load() was not populating the data field. I poked through to Lime.utils.Bytes and it looks like it’s failing at NativeCFFI.lime_bytes_read_file(path, bytes);

I managed to solve it by extending the FileReference class and overriding the load() function:

#if sys
override public function load():Void 
{
	this.data = ByteArray.fromBytes( File.getBytes(__path) );
	this.data.position = 0;
	openFileDialog_onComplete();
}
#end

Figured I’d mention it here in case anyone else runs into the same issue :slight_smile:

Might be fixable by running lime rebuild windows if you have the code from Github.

4 Likes