Jump to content
Sign in to follow this  
rudi

Problems with Korean Characters in Paths and Filenames

Recommended Posts

Hello,

 

trying to do some search Tasks I realized, that Korean Characters seem to give Trouble, when taken per DragDropAccepted GUI Input and trying to search with "_FileListToArrayRec", the path isn't fond.

 

This is how it Looks like, when I try to take the String from a "ConsoleWrite":

image.thumb.png.2177af43b8acdd2ed988662aa049d335.png

When doing later on with the found result a _FileList2ArrayRec() the path is invalid (cut off filename and last "\")

 

Propably some Unicode issue, Maybe some Option I Need to add to the GuiCtrlRead() for the Input box?

 

image.png.04c74a4552b2b70dda6e541bdbaec7f6.png

 

 

#include <GuiConstants.au3>
#include <GuiConstantsEx.au3>
#include <FileConstants.au3>
#include <EditConstants.au3>
#include <File.au3>
#include <Debug.au3>

$guiW = 800
$guiH = 500

GuiCreate('Test App', $guiW, $guiH, 100, 100, -1, $WS_EX_ACCEPTFILES)


$RootDir = ""

GUICtrlCreateLabel('drag drop main file:', 20, 20, $guiW - 40, 25)
Opt("guicoordmode", 2)
$dropIamfile = GUICtrlCreateInput("", -1, 5)
GUICtrlSetState(-1, $GUI_DROPACCEPTED)
GUICtrlSetTip(-1, 'You can drag & drop files here...')
$lRootDir = GUICtrlCreateLabel("Root Dir", -1, 5)


GUICtrlCreateLabel('drag drop missing file:', -1, 5)
$dropMissingFile = GUICtrlCreateInput("", -1, 5)
GUICtrlSetState(-1, $GUI_DROPACCEPTED)
GUICtrlSetTip(-1, 'You can drag & drop files here...')


$WinTitle = "Verknüpfung auflösen"
$WinTxt = "Unaufgelöste Referenz"
$CtrlFileName = "Edit1"



;GUI MESSAGE LOOP

GuiSetState()
While 1
    $msg = GuiGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            Exit
    EndSelect
    $IAM = GUICtrlRead($dropIamfile)
    if StringLeft($IAM, StringInStr($IAM, "\", 0, -1) - 1) = $RootDir Then
        ; nix geändert
    Else
        $RootDir = StringLeft($IAM, StringInStr($IAM, "\", 0, -1) - 1)
        ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $RootDir = ' & $RootDir & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console
        GUICtrlSetData($lRootDir, "Root Dir = " & $RootDir)
        MsgBox(0,"","done")
        Exit
    EndIf
    $Fehlt = ControlGetText($WinTitle, $WinTxt, $CtrlFileName)
    if $Fehlt <> "" and $RootDir <> "" Then
        MsgBox(0, "missing", $Fehlt)
        if StringInStr($Fehlt, "\") then
            ; done already
        Else
            $aFound = _FileListToArrayRec($RootDir, $Fehlt & ".*", 1, 1, 0, 1)
            ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') :         $aFound = ' & $aFound & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console
            _DebugArrayDisplay($aFound)
        EndIf
    EndIf
WEnd

 

 

image.png

Edited by rudi
typo in subject

Earth is flat, pigs can fly, and Nuclear Power is SAFE!

Share this post


Link to post
Share on other sites

Not sure if this will solve your issue but look at _WinAPI_CharToOem and _WinAPI_OemToChar. 

Share this post


Link to post
Share on other sites

Hello @Nine

 

thanks for your reply.

 

Meanwhile I've thought, that installing "Korean Language" to that Windows box might help and found this advise:

 

https://www.jihosoft.com/tips/download-install-windows-10-language-pack.html

 

After doing so (I deselected all the optional stuff, iirc handwriting, voice recognition and one other thing I've dropped) the korean chars are displayed correctly, Windows Explorer, CMD box, and Autoit GUI label texts.

 

I'll have to wait until after hours to see, if the issue is now solved with that language pack installation for Korean.

 

More info covering language packs for Windows 10: https://support.microsoft.com/help/14236/language-packs

Edited by rudi

Earth is flat, pigs can fly, and Nuclear Power is SAFE!

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...