| |
|
|
|
Description:
WideCharToMultiByte GetControlParas (B a Unicode String a Multi- or Singlebyte String circa.
Deklaration:
DEF @WideCharToMultiByte(8) !kernel32,WideCharToMultiByte
Parameter:
1.Parameter: Codepage number as Integer. => -0 = ANSI Codepage -1= OEM Codepage -2 = macintosh Codepage 2.Parameter: performance- and Umwandlungsflags as LongInt (can 0 his). 3.Parameter: area mt or address one Strings in the Unicode stature, the konvertiert go should. 4.Parameter: Number of letters in the string from Parameter 3. becomes here –1 indicated, becomes adopted, that the String with a Nullbyte end and the Size automatically accounts. 5.Parameter: enough dimensionierte Memory-Variable, The whom konvertierten String aufnimmt. 6.Parameter: Size the Bereichs of Parameter 5 as Integer. If this Parameter 0 is, gives The function The benötigte amount on Bytes for Parameter 5 back. 7.Parameter: address one Strings or Memory-Variable with a String, the a letters contains, the inserted becomes, if one Unicode character not Translated go can. this Parameter can 0 his – it'll then one Systemstandard uses. 8.Parameter: Memory-Variable, The The address one ? Happen? receiving, the indicating whether a character through one ‚Default’ (Parameter 7) supplant watts (can 0 his). => -1 = Yes -0 = No
Return Value:
If Parameter 6 on 0 staid and is The action succeed, supply The API as Return The erforderliche Size the Bereiches in Parameter 5. If Parameter 6 mismatched 0 and that the function successful completed watts, is the Return The Number of copied characters (+abschließendes Nullbyte). with Return 0 is a Error aufgetreten.
Examples:
CompileMarkSeparationDEF @WideCharToMultiByte(8) !"kernel32","WideCharToMultiByte"
DEF @MultiByteToWideChar(6) !"kernel32","MultiByteToWideChar"
DEF @GetACP(0) !"kernel32","GetACP"
Windowstyle 31
Windowtitle "Stringumwandlung ins Unicode Format"
Window 0,0-640,440
Declare Unicode#,SingleByte#,SingleByte$,Fehler&
DIM Unicode#,256*2
DIM SingleByte#,256
Clear Unicode#
LET SingleByte$=@input$("Bitte Wort eingeben","Stringumwandlung","Hallo")
LET Fehler&=@MultiByteToWideChar(@GetACP(),0,@ADDR(SingleByte$),-1,Unicode#,256*2)
Print "Rückmeldung von MultiByteToWideChar="+@STR$(Fehler&)
Print "Singlebyte="+SingleByte$
PRINT "Unicode="+@CHAR$(Unicode#,0,@LEN(SINGLEBYTE$)*2)
Let Fehler&=@WideCharToMultiByte(@GetACP(),0,Unicode#,-1,SingleByte#,256,0,0)
Print "Rückmeldung von WideCharToMultiByte="+@STR$(Fehler&)
Print "Zurück in Singlebyte="+@STRING$(Singlebyte#,0)
Dispose Unicode#
Dispose SingleByte#
While 0=0
Waitinput
Wend
|
|
|
| |
|
|