Russian characters in the console displays only the OEM866 and Unicode. Therefore, the command displays the Print scribble (this is normal!)MOD wrote:Try this code in a path with russian symbols:The first line will probably fail, but if the second line also fails to give you russians signs, then that's the problem.Code: Select all
Print ExePath Print WStr(ExePath) Sleep
However, if you use a normal messagebox the path in both cases returned correctly:
Code: Select all
#Include "windows.bi"
MessageBox(0, ExePath,"",0)
MessageBox(0, WStr(ExePath),"",0)
Maybe all the same for Windows (for encoding to Unicode) to use MultiByteToWideChar and WideCharToMultiByte ???:
Code: Select all
#Include once "windows.bi"
Function ASCIITOUTF(ByVal text As String) As WString Ptr export
Var blen = (Len(text)*2)+2
Dim As WString Ptr wbuf
wbuf = Allocate( blen )
MultiByteToWideChar(CP_ACP, 0,text , -1, wbuf, blen)
Return wbuf
End Function
Function UTFTOASCII(ByVal text As WString Ptr) As String Export
Var blen = WideCharToMultiByte (CP_ACP , 0,text , -1, 0, 0,0,0)
Dim As ZString ptr wbuf
Dim As String returnS
wbuf= allocate( blen )
WideCharToMultiByte (CP_ACP , 0,text , -1, Cast( LPSTR ,wbuf), blen,0,0)
returnS=*wbuf
DeAllocate(wbuf)
Return returnS
End Function