libcurl.pbi with UTF-8
Posted: Thu Feb 22, 2018 12:09 pm
I can't find the original post of libcurl.pbi, so i just make a new thread.
libcurl.pbi discards all none ASCII characters by the way it converts the string for libcurl.
Replace the procedure to enable UTF-8 encoding.
Edit: Fixed memory leak from original code.
Original code for reference: https://github.com/deseven/pbsamples/bl ... ibcurl.pbi
libcurl.pbi discards all none ASCII characters by the way it converts the string for libcurl.
Replace the procedure to enable UTF-8 encoding.
Code: Select all
Procedure.s str2curl(string.s)
Protected *curlstring
Protected PbCurlString.s
*curlstring = AllocateMemory(StringByteLength(string, #PB_UTF8) + 3)
PokeS(*curlstring,string,-1,#PB_UTF8)
PbCurlString = PeekS(*curlstring,-1)
FreeMemory(*curlstring)
ProcedureReturn PbCurlString
EndProcedure
Original code for reference: https://github.com/deseven/pbsamples/bl ... ibcurl.pbi