-
Notifications
You must be signed in to change notification settings - Fork 292
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid use of Encoding.WindowsCodePage
Fixes 7612
- Loading branch information
Showing
4 changed files
with
62 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
src/wix/test/WixToolsetTest.CoreIntegration/EncodingFixture.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. | ||
|
||
namespace WixToolsetTest.CoreIntegration | ||
{ | ||
using System.IO; | ||
using System.Linq; | ||
using WixInternal.Core.TestPackage; | ||
using WixInternal.TestSupport; | ||
using WixToolset.Data; | ||
using Xunit; | ||
|
||
public class EncodingFixture | ||
{ | ||
[Fact] | ||
public void PopulatesAppIdTableWhenAdvertised() | ||
{ | ||
var folder = TestData.Get(@"TestData"); | ||
|
||
using (var fs = new DisposableFileSystem()) | ||
{ | ||
var baseFolder = fs.GetFolder(); | ||
var intermediateFolder = Path.Combine(baseFolder, "obj"); | ||
var msiPath = Path.Combine(baseFolder, @"bin", "test.msi"); | ||
|
||
var result = WixRunner.Execute(new[] | ||
{ | ||
"build", | ||
Path.Combine(folder, "Encoding", "Encoding.wxs"), | ||
"-bindpath", Path.Combine(folder, "SingleFile", "data"), | ||
"-intermediateFolder", intermediateFolder, | ||
"-o", msiPath | ||
}); | ||
|
||
var errors = result.Messages.Where(m => m.Level == MessageLevel.Error).Select(m => m.ToString().Replace(folder, "<testdata>")).ToArray(); | ||
WixAssert.CompareLineByLine(new[] | ||
{ | ||
"A string was provided with characters that are not available in the specified database code page '1252'. Either change these characters to ones that exist in the database's code page, or update the database's code page by modifying one of the following attributes: Package/@Codepage, Module/@Codepage, Patch/@Codepage, or WixLocalization/@Codepage.", | ||
"A string was provided with characters that are not available in the specified database code page '1252'. Either change these characters to ones that exist in the database's code page, or update the database's code page by modifying one of the following attributes: Package/@Codepage, Module/@Codepage, Patch/@Codepage, or WixLocalization/@Codepage.", | ||
"A string was provided with characters that are not available in the specified database code page '1252'. Either change these characters to ones that exist in the database's code page, or update the database's code page by modifying one of the following attributes: Package/@Codepage, Module/@Codepage, Patch/@Codepage, or WixLocalization/@Codepage.", | ||
}, errors); | ||
} | ||
} | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
src/wix/test/WixToolsetTest.CoreIntegration/TestData/Encoding/Encoding.wxs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> | ||
<Package Name="Ć Not In 1252 Codepage" Version="3.0.0" Codepage="1252" Manufacturer="Example Company" Language="1033" UpgradeCode="11111111-1111-1111-1111-111111111111"> | ||
<StandardDirectory Id="ProgramFiles6432Folder"> | ||
<Directory Id="INSTALLFOLDER" Name="test"> | ||
</Directory> | ||
</StandardDirectory> | ||
|
||
<Feature Id="Main"> | ||
<Component Directory="INSTALLFOLDER"> | ||
<File Source="test.txt" /> | ||
</Component> | ||
</Feature> | ||
</Package> | ||
</Wix> |