Jump to content

Recommended Posts

Posted (edited)

Hi zeffy.Glad to see you on Autoit Forum.

This works for me fine:

#include <Array.au3>
#include <File.au3>
Dim $avarray


_FileReadToArray(@ScriptDir & "\language.txt",$avarray)

Run("cmd.exe /c " & $avarray[1],@ScriptDir,@SW_HIDE)

Here is language.txt file was saved with UTF8 encoding because its content writed in unicode: => əünı.exe

Script works fine and have`nt any problems.

+ You can use fileinstall() for include your language.txt.

I use this method on my native applications.

sORRY for my awfull English.

Edited by Sh3llC043r
[size="5"] [/size]
Posted

Hi zeffy.Glad to see you on Autoit Forum.

This works for me fine:

#include <Array.au3>
#include <File.au3>
Dim $avarray


_FileReadToArray(@ScriptDir & "\language.txt",$avarray)

Run("cmd.exe /c " & $avarray[1],@ScriptDir,@SW_HIDE)

Here is language.txt file was saved with UTF8 encoding because its content writed in unicode: => əünı.exe

Script works fine and have`nt any problems.

+ You can use fileinstall() for include your language.txt.

I use this method on my native applications.

sORRY for my awfull English.

That's not really what I mean lol, I have the script encoded with UTF-8 with BOM, but i can't get it to send unicode through Run() or ShellExecute(). Can anyone help me?
  • 1 month later...
Posted

I have a similar problem with IrfanView when trying to open unicode paths through AutoIt.

That image viewer opens for example a file in

E:\春の朝は寒い\SomeImage.jpg

perfectly fine if it's set to do so in the registry:

[HKEY_CLASSES_ROOT\IrfanView\shell\open\command]
@="\"D:\\Admin\\Common\\IrfanView\\i_view32.exe\" \"%1\""

But it won't do so when being called by

Dim $TestPath="E:\春の朝は寒い\SomeImage.jpg"
Run ("D:\Admin\Common\IrfanView\i_view32.exe " & $TestPath)
Exit

The funny thing is, when sending the same file to Word from Autoit, Word is able to see the file in the unicode path.

So for Word, the way Autoit is sending the unicode path string makes sense, but for IrfanView it doesn't.

IrfanView allegedly has only partial unicode support (only for filenames), and it does handle unicode filenames when called by the shell, but weirdly not from AutoIt.

Posted (edited)

perfectly fine if it's set to do so in the registry:

[HKEY_CLASSES_ROOT\IrfanView\shell\open\command]
@="\"D:\\Admin\\Common\\IrfanView\\i_view32.exe\" \"%1\""

The registry parameter being passed above is quoted i.e "%1"

But it won't do so when being called by

Dim $TestPath="E:\春の朝は寒い\SomeImage.jpg"
Run ("D:\Admin\Common\IrfanView\i_view32.exe " & $TestPath)
Exit

$TestPath above is not quoted.

Try the code below

Dim $TestPath="E:\春の朝は寒い\SomeImage.jpg"
Run ('"D:\Admin\Common\IrfanView\i_view32.exe" "' & $TestPath & '"')
Exit

Though I do not see white space as your issue. Give Shellexecute() a try with similar syntax as above.

Edited by MHz

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...