-
Notifications
You must be signed in to change notification settings - Fork 528
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Xamarin.Android.Build.Tasks] fix for utf8 chars and custom views (#4726
) Fixes: https://feedback.devdiv.io/955972 Context: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1084873 Context: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1130421 Android layout files with UTF-8 characters and custom views fail to build with: error APT2258: not well-formed (invalid token). In be47b3e, I inadvertently changed the `<ConvertCustomView/>` MSBuild task to save changes using [`Encoding.Default`][0], which defaults to the "ANSI" codepage on Windows, and thus cannot store the entirety of Unicode characters. `XDocumentExtensions.SaveIfChanged()` should instead use `MonoAndroidHelper.UTF8withoutBOM` by default. I updated two tests to reproduce this issue. Review other uses of `MemoryStreamPool.Shared.CreateStreamWriter()` and `Encoding.Default` in general to ensure that we're not using `Encoding.Default` where we shouldn't be. [0]: https://docs.microsoft.com/en-us/dotnet/api/system.text.encoding.default?view=netcore-3.1
- Loading branch information
1 parent
d298fda
commit 72bb668
Showing
5 changed files
with
13 additions
and
5 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
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
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