diff options
Diffstat (limited to 'src/WixToolset.Core')
-rw-r--r-- | src/WixToolset.Core/Common.cs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/WixToolset.Core/Common.cs b/src/WixToolset.Core/Common.cs index ebcbd36f..2d8f9509 100644 --- a/src/WixToolset.Core/Common.cs +++ b/src/WixToolset.Core/Common.cs | |||
@@ -172,6 +172,8 @@ namespace WixToolset.Core | |||
172 | /// <exception cref="WixException">The code page is invalid for summary information.</exception> | 172 | /// <exception cref="WixException">The code page is invalid for summary information.</exception> |
173 | public static int GetValidCodePage(string value, bool allowNoChange = false, bool onlyAnsi = false, SourceLineNumber sourceLineNumbers = null) | 173 | public static int GetValidCodePage(string value, bool allowNoChange = false, bool onlyAnsi = false, SourceLineNumber sourceLineNumbers = null) |
174 | { | 174 | { |
175 | Encoding.RegisterProvider(CodePagesEncodingProvider.Instance); | ||
176 | |||
175 | try | 177 | try |
176 | { | 178 | { |
177 | Encoding encoding; | 179 | Encoding encoding; |
@@ -190,7 +192,7 @@ namespace WixToolset.Core | |||
190 | return -1; | 192 | return -1; |
191 | } | 193 | } |
192 | 194 | ||
193 | encoding = CodePagesEncodingProvider.Instance.GetEncoding(codePage); | 195 | encoding = Encoding.GetEncoding(codePage); |
194 | } | 196 | } |
195 | else | 197 | else |
196 | { | 198 | { |
@@ -208,6 +210,11 @@ namespace WixToolset.Core | |||
208 | } | 210 | } |
209 | } | 211 | } |
210 | 212 | ||
213 | if (encoding == null) | ||
214 | { | ||
215 | throw new WixException(ErrorMessages.IllegalCodepage(sourceLineNumbers, codePage)); | ||
216 | } | ||
217 | |||
211 | return encoding.CodePage; | 218 | return encoding.CodePage; |
212 | } | 219 | } |
213 | catch (ArgumentException ex) | 220 | catch (ArgumentException ex) |