Skip to content

Possible issue with gnugettext.pas #237

Open

Description

@SkybuckFlying

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.

Activity

  1. SkybuckFlying commented on Dec 22, 2021

    @SkybuckFlying
    ContributorAuthor

    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.

  2. CFTechno commented on Jan 16, 2022

    @CFTechno
    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.

  3. SkybuckFlying commented on Jan 26, 2022

    @SkybuckFlying
    ContributorAuthor

    {$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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions