You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Nota.CodeAnalysis.Verification/verify-package.sh
+9-1Lines changed: 9 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -130,15 +130,23 @@ printf 'namespace App;\n\n/// <summary>Saved in the wrong encoding on purpose.</
130
130
printf'\346\370\345'>>"$app/MisEncoded.cs"
131
131
printf'";\n}\n'>>"$app/MisEncoded.cs"
132
132
133
+
# A UTF-8 byte order mark, for NOTA0002. Separate from the file above on purpose: NOTA0001 stopping
134
+
# at the first byte of a mis-encoded file would hide it, and a mark on an otherwise clean file is the
135
+
# case that actually occurs.
136
+
printf'\357\273\277'>"$app/Marked.cs"
137
+
printf'namespace App;\n\n/// <summary>Carries a UTF-8 byte order mark on purpose.</summary>\npublic static class Marked\n{\n /// <summary>Ordinary text.</summary>\n public const string T = "marked";\n}\n'>>"$app/Marked.cs"
"File begins with a UTF-8 byte order mark. Re-save it as UTF-8 without one, or strip the tree with tools/de-bom.sh from Nota.CodeAnalysis - and close the editor while you do, since one that opened the file with a mark writes the mark back on the next save.");
91
+
}
92
+
53
93
try
54
94
{
55
95
new System.Text.UTF8Encoding(false, true).GetString(bytes);
@@ -80,7 +120,7 @@
80
120
<TargetName="NotaValidateSourceEncoding"
81
121
BeforeTargets="CoreCompile"
82
122
Condition="'$(NotaValidateSourceEncoding)' == 'true' AND '@(Compile)' != ''">
0 commit comments