File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed
Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change 22using System . IO ;
33using System . Linq ;
44using System . Reflection ;
5+ using System . Text ;
56using ICSharpCode . CodeConverter . Common ;
67using Microsoft . CodeAnalysis ;
78
@@ -15,6 +16,10 @@ public static class CompilerExtensions
1516 /// <remarks>The transitive closure of the references for <paramref name="requiredAssemblies"/> are added.</remarks>
1617 public static Assembly AssemblyFromCode ( this ICompiler compiler , SyntaxTree syntaxTree , params Assembly [ ] requiredAssemblies )
1718 {
19+ // Register CodePages encoding provider for Windows-1252 and other code pages
20+ // This is needed for VB.NET Chr() function which relies on code page specific encodings
21+ Encoding . RegisterProvider ( CodePagesEncodingProvider . Instance ) ;
22+
1823 var allReferences = DefaultReferences . With ( requiredAssemblies ) ;
1924 var compilation = compiler . CreateCompilationFromTree ( syntaxTree , allReferences ) ;
2025
You can’t perform that action at this time.
0 commit comments