diff options
author | Bob Arnson <bob@firegiant.com> | 2018-09-06 20:33:40 -0400 |
---|---|---|
committer | Bob Arnson <bob@firegiant.com> | 2018-09-06 20:33:40 -0400 |
commit | 38b6fe65e36ed9442e3fc714dea1793d457f0b20 (patch) | |
tree | 1bcb7a70194e9d4627c51437b35edbecedece662 /src/WixToolset.Core | |
parent | c72297466821e6ca856866cd48726c919554b580 (diff) | |
download | wix-38b6fe65e36ed9442e3fc714dea1793d457f0b20.tar.gz wix-38b6fe65e36ed9442e3fc714dea1793d457f0b20.tar.bz2 wix-38b6fe65e36ed9442e3fc714dea1793d457f0b20.zip |
Fix codepage handling to cover both Framework- and Core- supported code pages.
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) |