Seite 1 von 1

newlisp.dll UTF8 used with purebasic 5.62

Verfasst: 07.10.2018 15:02
von HPW
Hallo,

Heute hatte ich etwas Zeit um diese Kombination zu testen: newlisp.dll UTF8 mit purebasic 5.62
Da purebasic ein unicode compiler ist, ist es interessant die newlisp.dll UTF8-Variante zu nutzen.

Import der Dll ist einfach:

Code: Alles auswählen

 OpenLibrary(0,"newlisp_utf8.dll")
Der Aufruf kann so aussehen:

Code: Alles auswählen

sourcestr.s = GetGadgetText(#Gadget_Form1_String3)
*newlispstr = AllocateMemory(StringByteLength(sourcestr) + SizeOf(Character))
PokeS(*newlispstr, sourcestr, Len(sourcestr),#PB_UTF8)
retstr.s = PeekS(CallFunction(0,"newlispEvalStr",*newlispstr),-1,#PB_UTF8)
FreeMemory(*newlispstr)
SetGadgetText(#Gadget_Form1_Editor5, retstr)
Am Ende kann man (nicht notwenig, aber sauber)

Code: Alles auswählen

 CloseLibrary(0)
Grüsse
Hans-Peter

Re: newlisp.dll UTF8 used with purebasic 5.62

Verfasst: 08.10.2018 18:08
von HPW
Hallo,

Nach einem Hinweiss von Fred im franz. Forum gibt es dort einen verbesserten Code.

https://www.purebasic.fr/english/viewto ... 12&t=71527

Grüsse,

Re: newlisp.dll UTF8 used with purebasic 5.62

Verfasst: 14.10.2018 15:36
von HPW
Hallo,

Hier die aktuelle Version mit CallBacks:
http://forums.purebasic.com/german/view ... 2&start=10

Grüsse