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

Moho allows users to write new tools and plugins. Discuss scripting ideas and problems here.

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
User avatar
570295535
Posts: 32
Joined: Sat Feb 04, 2023 9:32 am

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

Post 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
I'm from China, currently using: Moho 15 » Win10 System
:D :D :D :D :D :D :D :D :D :D :D
User avatar
SimplSam
Posts: 1218
Joined: Thu Mar 13, 2014 5:09 pm
Location: London, UK
Contact:

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

Post 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.
Moho 14.3 » Win 11 Pro 64GB » NVIDIA GTX 1080ti 11GB
Moho 14.3 » Mac mini 2012 8GB » macOS 10.15 Catalina
Tube: SimplSam


Sam
User avatar
570295535
Posts: 32
Joined: Sat Feb 04, 2023 9:32 am

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

Post 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.
I'm from China, currently using: Moho 15 » Win10 System
:D :D :D :D :D :D :D :D :D :D :D
Post Reply