Skip to content

Commit 38363e8

Browse files
committed
Fix garbled (C) symbol in generated source code
Replaced literal (C) symbol in resourcestring statements with constant name. Defined COPYRIGHT constant in UConsts unit as the appropriate Unicode hex character code. Fixes #80
1 parent 438ef9d commit 38363e8

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

Src/UConsts.pas

+2
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ interface
3636
GT = '>'; // greater-than / closing angle bracket character
3737
LT = '<'; // less-than / opening angle bracket character
3838

39+
COPYRIGHT = #$00A9;
40+
3941
CRLF = CR + LF; // carriage return followed by line feed
4042
EOL = CRLF; // end of line character sequence for Windows systems
4143
EOL2 = EOL + EOL; // 2 end of line sequences

Src/USaveUnitMgr.pas

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
{
1+
{
22
* This Source Code Form is subject to the terms of the Mozilla Public License,
33
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
44
* obtain one at https://mozilla.org/MPL/2.0/
55
*
6-
* Copyright (C) 2006-2021, Peter Johnson (gravatar.com/delphidabbler).
6+
* Copyright (C) 2006-2022, Peter Johnson (gravatar.com/delphidabbler).
77
*
88
* Defines a class that manages generation, previewing and saving of a pascal
99
* unit.
@@ -98,6 +98,7 @@ implementation
9898
// Project
9999
DB.UMetaData,
100100
UAppInfo,
101+
UConsts,
101102
UUrl,
102103
UUtils;
103104

@@ -115,8 +116,9 @@ implementation
115116
// Error message
116117
sErrorMsg = 'Filename is not valid for a Pascal unit';
117118
// Unit header comments
118-
sLicense = 'The unit is copyright � %0:s by %1:s and is licensed under '
119-
+ 'the %2:s.';
119+
sLicense = 'The unit is copyright '
120+
+ COPYRIGHT
121+
+ ' %0:s by %1:s and is licensed under the %2:s.';
120122
sMainDescription = 'This unit was generated automatically. It incorporates a '
121123
+ 'selection of source code taken from the Code Snippets Database at %0:s.';
122124
sGenerated = 'Generated on : %0:s.';

Src/USnippetSourceGen.pas

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
{
1+
{
22
* This Source Code Form is subject to the terms of the Mozilla Public License,
33
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
44
* obtain one at https://mozilla.org/MPL/2.0/
55
*
6-
* Copyright (C) 2006-2021, Peter Johnson (gravatar.com/delphidabbler).
6+
* Copyright (C) 2006-2022, Peter Johnson (gravatar.com/delphidabbler).
77
*
88
* Implements a static class that generates source code for code snippet(s)
99
* contained in a routine snippet or category view.
@@ -90,6 +90,7 @@ implementation
9090
DB.UMetaData,
9191
DB.USnippet,
9292
DB.USnippetKind,
93+
UConsts,
9394
UAppInfo,
9495
UQuery,
9596
UUtils;
@@ -108,8 +109,9 @@ function TSnippetSourceGen.BuildHeaderComments: IStringList;
108109
// when snippets include those from main database
109110
sMainDBGenerator = 'This code snippet was generated by %0:s %1:s on %2:s.';
110111
sMainDBLicense = 'It includes code taken from the DelphiDabbler Code '
111-
+ 'Snippets database that is copyright � %0:s by %1:s and is licensed '
112-
+ 'under the %2:s.';
112+
+ 'Snippets database that is copyright '
113+
+ COPYRIGHT
114+
+ ' %0:s by %1:s and is licensed under the %2:s.';
113115
// when snippets are all from user defined database
114116
sUserGenerator = 'This user defined code snippet was generated by '
115117
+ '%0:s %1:s on %2:s.';

0 commit comments

Comments
 (0)