Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible issue with gnugettext.pas #237

Open
SkybuckFlying opened this issue Dec 21, 2021 · 3 comments
Open

Possible issue with gnugettext.pas #237

SkybuckFlying opened this issue Dec 21, 2021 · 3 comments

Comments

@SkybuckFlying
Copy link
Contributor

SkybuckFlying commented Dec 21, 2021

In \PascalCoin\src\libraries\gnugettext.pas line 1424:

function utf8decode (s:RawByteString):UnicodeString; {$ifdef dx_has_Inline}inline;{$endif}
begin
  Result:=UTF8ToWideString(s);
end;

The call to UTF8ToWideString(s); may have to be replaced with: UTF8ToUnicodeString(s);

This may solve problems with this library, untested, but worth a try.

@SkybuckFlying
Copy link
Contributor Author

SkybuckFlying commented Dec 22, 2021

A newer version of gnugettext.pas is available here, it also applied the fix mentioned above:

https://sourceforge.net/p/dxgettext/code/HEAD/tree/trunk/dxgettext/sample/gnugettext.pas

This newer version could be tried as well to see if it fixes any exception errors on shutdown.

@CFTechno
Copy link
Contributor

FYI: The gnugettext in pascalcoin repository has been changed to include latests fpc/lazarus changes as only the delphi part of gnugettext was maintained. Updated sources were send to maintainer at sourceforge but never any reply. Could be therefore that the sourceforge version will not compile at all with fpc/lazarus.

@SkybuckFlying
Copy link
Contributor Author

SkybuckFlying commented Jan 26, 2022

{$IFDEF UNICODE}
function utf8decode (s:RawByteString):UnicodeString; {$ifdef dx_has_Inline}inline;{$endif}
begin
Result:=UTF8ToUnicodeString(s);
end;
{$endif}

UNICODE is not defined, therefore this fix won't work unless UNICODE is defined somewhere. Not sure if PascalCoin or the original file was like that. A bit strange.

Strangely enough this line of code is never executed, call me confused, could have sworn it gets called somewhere, probably somewhere outside a unit, maybe in a different configuration, not sure, giving up on this for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants