Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Nuget nuspec files UTF-16 encoding issue #226

Merged
merged 37 commits into from
Dec 27, 2023
Merged
Show file tree
Hide file tree
Changes from 33 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
6f4d83a
copy dir
sverdlov93 Aug 31, 2023
99ea1c7
copy dir
sverdlov93 Aug 31, 2023
a2be3c3
copy dir
sverdlov93 Aug 31, 2023
15c2382
copy dir
sverdlov93 Aug 31, 2023
d1ba553
copy dir
sverdlov93 Aug 31, 2023
8d2df18
Merge branch 'dev' of https://github.com/jfrog/build-info-go into cop…
sverdlov93 Aug 31, 2023
43f807c
copy dir
sverdlov93 Aug 31, 2023
6588932
Merge branch 'dev' of https://github.com/jfrog/build-info-go into cop…
sverdlov93 Sep 10, 2023
71df92d
fix build script
sverdlov93 Sep 10, 2023
417516b
Update release/pipelines.yml
sverdlov93 Sep 10, 2023
d37e048
fix build script
sverdlov93 Sep 10, 2023
014b05b
Merge branch 'fix-script' of https://github.com/jfrog/build-info-go i…
sverdlov93 Sep 10, 2023
d15dfa7
fix build script
sverdlov93 Sep 10, 2023
3f6f620
fix build script
sverdlov93 Sep 12, 2023
4723df3
fix build script
sverdlov93 Sep 14, 2023
b9c2b05
fix build script
sverdlov93 Sep 14, 2023
6e1e42a
fix build script
sverdlov93 Sep 14, 2023
1a05c72
Merge branch 'dev' of https://github.com/jfrog/build-info-go into cop…
sverdlov93 Sep 14, 2023
8ecbe93
fix build script
sverdlov93 Sep 14, 2023
08989d7
fix build script
sverdlov93 Sep 14, 2023
46d3a23
Merge branch 'dev' of https://github.com/jfrog/build-info-go into cop…
sverdlov93 Sep 20, 2023
a6875ca
fix build script
sverdlov93 Sep 20, 2023
cf1f3c5
Update utils/fileutils.go
sverdlov93 Sep 26, 2023
b280efb
fix build script
sverdlov93 Sep 26, 2023
8685f45
Merge branch 'fix-scripts' of https://github.com/sverdlov93/build-inf…
sverdlov93 Sep 26, 2023
c94d472
fix build script
sverdlov93 Sep 26, 2023
c98060b
Merge branch 'dev' of https://github.com/jfrog/build-info-go into cop…
sverdlov93 Sep 27, 2023
74d3cd1
fix build script
sverdlov93 Sep 27, 2023
59bf15d
Merge branch 'dev' into fix-scripts
sverdlov93 Sep 27, 2023
efc1cb3
Merge branch 'dev' of https://github.com/jfrog/build-info-go into cop…
sverdlov93 Dec 18, 2023
b474922
fix latest build
sverdlov93 Dec 27, 2023
8ad49bd
Merge branch 'dev' of https://github.com/jfrog/build-info-go into cop…
sverdlov93 Dec 27, 2023
5acf77b
fix latest build
sverdlov93 Dec 27, 2023
c3e3e94
fix latest build
sverdlov93 Dec 27, 2023
ba9935c
fix latest build
sverdlov93 Dec 27, 2023
0d113f2
Merge branch 'dev' into fix-scripts
sverdlov93 Dec 27, 2023
5e7fd1c
fix latest build
sverdlov93 Dec 27, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions build/utils/dotnet/dependencies/packagesconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,11 @@ func createNugetPackage(packagesPath string, nuget xmlPackage, nPackage *nugetPa
if err != nil {
return nil, err
}

// Sometimes the nuspec file is wrongly encoded in utf-16, the actual encoding is utf-8 but the xml header has 'enocding="utf-16"' key.
// xml.Unmarshal doesn't support utf-16 encoding, so we need to convert the header to utf-8.
utf8String := strings.Replace(string(nuspecContent), "utf-16", "utf-8", 1)
sverdlov93 marked this conversation as resolved.
Show resolved Hide resolved
nuspec := &nuspec{}
err = xml.Unmarshal(nuspecContent, nuspec)
err = xml.Unmarshal([]byte(utf8String), nuspec)
if err != nil {
pack := nPackage.id + ":" + nPackage.version
log.Warn("Package:", pack, "couldn't be parsed due to:", err.Error(), ". Skipping the package dependency.")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-16"?>
<package>
<metadata>
<id>id2</id>
Expand Down
Loading