Page 1 of 1

[Resolved]Moho script code cannot read path files with non English names(including Chinese and Japanese)

Posted: Fri Aug 30, 2024 11:57 am
by 570295535
This problem has been bothering me for a long time. Today, on Discord, I saw SimplSam's sharing of utf8_filenames.lua, and with a try it out attitude, I didn't expect it to really solve the problem(Chinese and Japanese, excluding Korean).

Just copy utf8_filenames.lua, files that were previously not supported for reading can now be read, but I have provided a simple script file to demonstrate.

method:
1. Copy utf8_filenames.lua to the folder: C:\Program Files\Moho 14\Resources\Support\Scripts\Utility
2. Copy xsz_ReadnonEnglishfile.lua to the folder: C:\Program Files\Moho 14\Resources\Support\Scripts\Tool
3. Open Moho and use this script to test file reading. If successful, the content of the first line of the file will be returned.

Download link:https://pan.huang1111.cn/s/Nk9z4H1

Re: [Resolved]Moho script code cannot read path files with non English names(including Chinese and Japanese)

Posted: Sun Sep 01, 2024 10:01 am
by SimplSam
Good work, but you should not be modifying files in C:\Program Files\Moho 14\, but rather use your <Custom Content Folder>

So essentially - someone should only need to place 'utf8_filenames.lua' in <Custom Content Folder>\Scripts\Utility\

I tried this, but I think it only works with non-English filename characters that match your computers' codepage / system locale.

Re: [Resolved]Moho script code cannot read path files with non English names(including Chinese and Japanese)

Posted: Sun Sep 01, 2024 11:18 am
by 570295535
SimplSam wrote: Sun Sep 01, 2024 10:01 am Good work, but you should not be modifying files in C:\Program Files\Moho 14\, but rather use your <Custom Content Folder>
Sorry, I overlooked this issue because I have been using Moho without setting up the<Custom Content Folder>myself.
Due to frequent script creation and concerns about program crashes and data loss, I created my own one click installation and uninstallation of Moho and scripts. Not setting<Custom Content Folder>can save me some time and avoid some folder confusion.