Subject: Re: Porting to AmigaOS4 thread by jabirulo on 2020/11/22 15:03:51
@Raziel
Alas I don't know if crash/GR will be solved I updated utf8ToLocal() function/method:
...
//if (dstmib != CS_MIBENUM_INVALID) {
if(dstmib != NULL) {
//LONG dstlen = FSGetByteSize((APTR)in, -1, CS_MIBENUM_UTF_8, dstmib);
ULONG dstlen = 0;//ICodesets->CodesetsStrLen(in, TAG_END);
STRPTR dst_str = ICodesets->CodesetsConvertStr(CSA_SourceCodeset, srcmib,
CSA_DestCodeset, dstmib,
CSA_Source, in,
CSA_DestLenPtr, &dstlen,
TAG_DONE);
if( (dst_str!= NULL) {
char *out = (char *)malloc(dstlen + 1);
if(out) {
strcpy(out, dst_str, dstlen);
ICodesets->CodesetsFreeA(dst_str, NULL);
IExec->DropInterface( (struct Interface *)ICodesets );
ICodesets = NULL;
IExec->CloseLibrary(CodesetsBase);
CodesetsBase = NULL;
return out;
}
free(out);
}
}
...
NOTE: if you get an error with "STRPTR" definition doesn't exists, just change it to "char *"
Does the crash/GR happen too if you click on ASL's CANCEL button?
NOTE2: I suspect "out" will be freed when exit/destroying the Common class.
|