Skip to content

Commit

Permalink
fix NullReferenceException on macOS on /!codepages/ page
Browse files Browse the repository at this point in the history
  • Loading branch information
atauenis committed Apr 16, 2023
1 parent 2350037 commit 2d10519
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -403,8 +403,9 @@ internal static Encoding GetCodePage(string CP)
* ISO-8859-1 = Latin-1 (Western European)
* English, Faeroese, German, Icelandic, Irish, Italian, Norwegian, Portuguese, Rhaeto-Romanic, Scottish Gaelic, Spanish, Catalan, and Swedish
* Danish (partial), Dutch (partial), Finnish (partial), French (partial)
* Not supported on some macOS servers! To skip NULL return, use CP1252, which is 75% same as Latin-1.
*/
return CodePagesEncodingProvider.Instance.GetEncoding("iso-8859-1");
return CodePagesEncodingProvider.Instance.GetEncoding("iso-8859-1") ?? CodePagesEncodingProvider.Instance.GetEncoding("windows-1252");
case "bs":
case "pl":
case "cr":
Expand Down

0 comments on commit 2d10519

Please sign in to comment.