Skip to content

Commit

Permalink
Lazarus example: add comment to string encoding conversion methods
Browse files Browse the repository at this point in the history
  • Loading branch information
aspettl committed Oct 1, 2016
1 parent 86dd81f commit d06106e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Example_Lazarus/exampleunit.pas
Original file line number Diff line number Diff line change
Expand Up @@ -179,11 +179,19 @@ implementation

function GUIStringToDefaultString(const s: UTF8String): String;
begin
// with FPC 2.6, the strings in the GUI are UTF-8 and they have to be
// converted to the standard ANSI strings
// (with FPC 3.0 and UTF-8 mode / codepage-aware strings, this is not
// necessary anymore)
Result := Utf8ToAnsi(s);
end;

function DefaultStringToGUIString(const s: String): UTF8String;
begin
// with FPC 2.6, the strings in the GUI are UTF-8 and they have to be
// converted to the standard ANSI strings
// (with FPC 3.0 and UTF-8 mode / codepage-aware strings, this is not
// necessary anymore)
Result := AnsiToUtf8(s);
end;

Expand Down

0 comments on commit d06106e

Please sign in to comment.