Results 1 to 5 of 5

Thread: 1.11.2.0 New Issue: Cannot Run Script on Path with Chinese

  1. #1
    Member
    Join Date
    Jan 2017
    Location
    changsha China
    Age
    32
    Posts
    80
    Rep Power
    16

    1.11.2.0 New Issue: Cannot Run Script on Path with Chinese

    This problem did not exist in previous versions of ThinBasic
    I verified that this problem also occurs with thinAir

    For example, ThinBasic is installed on the C drive. The default path is C: \ ThinBasic. This is to rename the ThinBasic folder to any Chinese name, and then create a script file with a tbasic suffix. This script file will not run.

  2. #2
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,782
    Rep Power
    10
    Do not remember to have changed something in that area.

    What exact version were you using before?
    So I can check what I changed


    ... just thinking ...
    if you are invoking thinBasic.exe with full path from your application ... it should work.
    But if you change thinBasic path after installation ... there could be problem with thinBasic executed from the shell because during installation some registry keys are set:
    Here below {app} is the path where you decided to install thinBasic during setup

    [Registry]
    ;install path
    Root: HKLM; Subkey: SOFTWARE\ThinBasic; ValueType: string; ValueName: InstallPath; Flags: noerror CreateValueIfDoesntExist DeleteValue; ValueData: {app}\;


    ;tbasic
    Root: HKCR; SubKey: .tBasic; ValueType: string; ValueName: ; ValueData: thinBasic.Script.File; Flags: uninsdeletekey
    Root: HKCR; SubKey: thinBasic.Script.File; ValueType: string; ValueName: ; ValueData: thinBasic.Script.File; Flags: uninsdeletekey
    Root: HKCR; Subkey: thinBasic.Script.File\DefaultIcon; ValueType: string; ValueName: ; ValueData: "{app}\thinBasic.exe,0"; Flags: uninsdeletekey
    Root: HKCR; SubKey: thinBasic.Script.File\shell\Open\command; ValueType: string; ValueData: "{app}\thinBasic.exe ""%1"""; Flags: uninsdeletekey;
    Root: HKCR; SubKey: thinBasic.Script.File\shell\Edit\command; ValueType: string; ValueData: "{app}\thinAir\thinAir.exe ""%1"""; Flags: uninsdeletekey;
    Root: HKCR; SubKey: thinBasic.Script.File\shell\thinDebug\command; ValueType: string; ValueData: "{app}\thinBasic.exe @D ""%1"""; Flags: uninsdeletekey;
    Last edited by ErosOlmi; 26-01-2020 at 19:40.
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  3. #3
    Member
    Join Date
    Jan 2017
    Location
    changsha China
    Age
    32
    Posts
    80
    Rep Power
    16
    Quote Originally Posted by ErosOlmi View Post
    Do not remember to have changed something in that area.

    What exact version were you using before?
    So I can check what I changed


    ... just thinking ...
    if you are invoking thinBasic.exe with full path from your application ... it should work.
    But if you change thinBasic path after installation ... there could be problem with thinBasic executed from the shell because during installation some registry keys are set:
    Here below {app} is the path where you decided to install thinBasic during setup

    [Registry]
    ;install path
    Root: HKLM; Subkey: SOFTWARE\ThinBasic; ValueType: string; ValueName: InstallPath; Flags: noerror CreateValueIfDoesntExist DeleteValue; ValueData: {app}\;


    ;tbasic
    Root: HKCR; SubKey: .tBasic; ValueType: string; ValueName: ; ValueData: thinBasic.Script.File; Flags: uninsdeletekey
    Root: HKCR; SubKey: thinBasic.Script.File; ValueType: string; ValueName: ; ValueData: thinBasic.Script.File; Flags: uninsdeletekey
    Root: HKCR; Subkey: thinBasic.Script.File\DefaultIcon; ValueType: string; ValueName: ; ValueData: "{app}\thinBasic.exe,0"; Flags: uninsdeletekey
    Root: HKCR; SubKey: thinBasic.Script.File\shell\Open\command; ValueType: string; ValueData: "{app}\thinBasic.exe ""%1"""; Flags: uninsdeletekey;
    Root: HKCR; SubKey: thinBasic.Script.File\shell\Edit\command; ValueType: string; ValueData: "{app}\thinAir\thinAir.exe ""%1"""; Flags: uninsdeletekey;
    Root: HKCR; SubKey: thinBasic.Script.File\shell\thinDebug\command; ValueType: string; ValueData: "{app}\thinBasic.exe @D ""%1"""; Flags: uninsdeletekey;
    Thank you very much, ErosOlmi. I made some attempts and found that my file path was garbled due to encoding problems. After checking the updated document, I found that because the new version uses utf8 in full, I was negligent. Misleading, you can delete this post.

    1.11.2.0 is no problem, it works well, and the full switch to UTF-8 is good news

  4. #4
    Member
    Join Date
    Jan 2017
    Location
    changsha China
    Age
    32
    Posts
    80
    Rep Power
    16
    I tested it again completely. It seems that the current support for UTF-8 is not complete.

    I set the file encoding to ANSI (GBK) and opened it with ThinAir. The Chinese characters in the file content could not be displayed properly, and running and generating the EXE could not be performed correctly (if the file path is all English, it can be run, but the Chinese characters cannot be displayed).

    After that, I changed the file encoding to utf-8, and now it is displayed normally, the file can run, but except for a few extension libraries such as the UI library and file library that support utf-8, most of the libraries must be converted to encoding, and the encoding is changed to utf- Changes to 8 are still in progress, so this is not a problem.

    However, when I tried to generate the EXE, I found that when the utf-8 encoded file was parsed, many places could not handle Chinese correctly. For example, the dependent extension library, if the path is Chinese (the easiest way to reproduce is to change the ThinBasic installation directory Into a Chinese directory), it cannot be displayed correctly. If the file #Include contains Chinese, the error will be reported directly.

    I do n’t know if you can easily reproduce this problem, or what I can do for you. After all, it ’s not easy to input Chinese characters on an English computer. I ’ll provide some Chinese characters, you can copy the test :中文测试字符



    In addition, I am very interested in the UI extension library. Can ErosOlmi use me as one of the maintainers of this library? I have developed Win32SDK-based interface library in FreeBasic: https://gitee.com/xywhsoft/xui

    I noticed that this extension library supports controlling the control and triggering events directly through the control name without WndProc. I think this is very friendly to novices, but there is still a lot of room for improvement in this part of the function. Maybe I can contribute a little here power.

  5. #5
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,782
    Rep Power
    10
    Thanks a lot for reporting all those details.
    Yes UTF-8 is still under heavy update in all modules.
    I will see if I can fix some of them and let you work more easily.

    Regarding UI module ... actually it is written in un-elegant way not suitable to be published as source code but it can be an idea.
    I'm continuing to update it in order to have easy dotted notation that seems a good way to simplify script.

    If you check 1.11.3 alpha version and script \thinBasic\SampleScripts\UI\Resources\Resources_Test_001.tbasic you will see some improvements in controls handling.
    Last edited by ErosOlmi; 04-02-2020 at 13:09.
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

Similar Threads

  1. Does not work when there is a space in the path
    By xLeaves in forum thinBasic General
    Replies: 12
    Last Post: 19-07-2019, 15:03
  2. Path variable backup
    By zak in forum Shout Box Area
    Replies: 1
    Last Post: 27-07-2011, 07:27
  3. Other resources on path solving
    By ErosOlmi in forum AStar - (A Star) path-finding algorithm
    Replies: 7
    Last Post: 07-10-2007, 15:07

Members who have read this thread: 0

There are no members to list at the moment.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •