-
Notifications
You must be signed in to change notification settings - Fork 35
Closed
Labels
bugBug reportBug reportcompletedWork has been completed on this issue and changes have been committed to `develop` branch..Work has been completed on this issue and changes have been committed to `develop` branch..
Description
Plain text is always previewed in Unicode. This works fine for the Unicode LE & BE encodings and UTF-8. But this doesn't work properly if the user selected ANSI text. For example if a snippet with a character that is not supported in the default ANSI code page, the ANSI rendering could be different to the Unicode encodings, but the preview will be correct.
For example, the following output, rendered in Unicode, is:
Σ
Sums an array of integers.
function Σ(const A: array of Integer): Integer;
var
Elem: Integer;
begin
Result := 0;
for Elem in A do
Result := Result + Elem;
end;
Snippet Type:
Routine
Category:
User Defined Snippets
Required units:
None.
Required snippets:
None.
See also:
None.
Compiler test results:
Delphi XE Compiles OK
Delphi 12.x Compiles OK
But when ANSI is selected (in the UK), the preview is as above, but the actual file content is:
S
Sums an array of integers.
function S(const A: array of Integer): Integer;
var
Elem: Integer;
begin
Result := 0;
for Elem in A do
Result := Result + Elem;
end;
Snippet Type:
Routine
Category:
User Defined Snippets
Required units:
None.
Required snippets:
None.
See also:
None.
Compiler test results:
Delphi XE Compiles OK
Delphi 12.x Compiles OK
Metadata
Metadata
Assignees
Labels
bugBug reportBug reportcompletedWork has been completed on this issue and changes have been committed to `develop` branch..Work has been completed on this issue and changes have been committed to `develop` branch..
Projects
Milestone
Relationships
Development
Select code repository
Activity
delphidabbler commentedon Apr 22, 2025
⚠ If this issue is resolved before the next release, the DO NOT add this issue to the change log.
delphidabbler commentedon Apr 28, 2025
Same problem with Markdown preview (added to
develop
at merge commit 19dc440)Fix snippet info preview bug for ANSI encodings
delphidabbler commentedon Apr 28, 2025
Fixed at commit 6e8e0f7 - do not include in change log.
delphidabbler commentedon Apr 28, 2025
Fixed at commit 4b77024 - do not include in change log.
delphidabbler commentedon May 2, 2025
This issue did occur in v4.25.0 of the Save Unit and Save Annotated Source dialogue box, so this fix MUST be included in the the change log.