Bug 58301 - Text editor adds byte order mark (BOM) to modified files
Summary: Text editor adds byte order mark (BOM) to modified files
Status: RESOLVED ANSWERED
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: General (show other bugs)
Version: 4.6.0 (15.3)
Hardware: PC Windows
: Normal normal
Target Milestone: 15.6
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2017-07-21 18:14 UTC by Jon Douglas [MSFT]
Modified: 2017-10-06 01:20 UTC (History)
5 users (show)

See Also:
Tags: ac
Is this bug a regression?: ---
Last known good build:


Attachments

Description Jon Douglas [MSFT] 2017-07-21 18:14:07 UTC
*Description with Use-case:

In Xamarin.Android and using the "Proguard" feature, one can specify a custom Proguard.cfg file which specifies rules for Proguard to follow.

To do this, one would create a new file called "Proguard.cfg" and add the Build Action of "ProguardConfiguration".

Now the user can add their rules inside this Proguard.cfg file. The problem however is that the Proguard.jar tooling requires the file to not have a BOM(byte order mark). I describe this problem here:

https://developer.xamarin.com/guides/android/deployment,_testing,_and_metrics/proguard/#File_Issues

Now although this is a more generic issue regarding adding a BOM to any modified file, it makes the use case of editing any file that needs to have no BOM almost impossible. Thus the user would have to stay away from Visual Studio when editing these files to ensure the BOM isn't re-added.

I've tried just about every editor inside the "Open With" dialog, but they all seem to re-add the BOM.

There is a very similar issue for Visual Studio for Mac here:

https://bugzilla.xamarin.com/show_bug.cgi?id=26819

*Expected Behavior:

Saving a file without BOM would remain without a BOM

*Actual Behavior:

Saving a file without BOM adds a BOM causing tooling to fail

*Version Information:

Microsoft Visual Studio Enterprise 2017 
Version 15.2 (26430.16) Release

Xamarin   4.5.0.486 (fec6f88)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android SDK   7.3.1.2 (9dbc4c5)
Xamarin.Android Reference Assemblies and MSBuild support.

Xamarin.iOS and Xamarin.Mac SDK   10.10.0.37 (ad35de4)
Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.
Comment 1 Prashant [MSFT] 2017-07-24 06:38:07 UTC
I can confirm using the latest Visual Studio 2017 Preview version 15.3 I am able to reproduce this issue. Marking this report as CONFIRMED. 

However, you can find the work around at https://developer.xamarin.com/guides/android/deployment,_testing,_and_metrics/proguard/#File_Issues
Comment 2 Pierce Boggan [MSFT] 2017-08-21 18:11:01 UTC
This issue makes Proguard very difficult to work with on Windows (which most serious apps will be using). We should try and fix this in 15.5 if possible.
Comment 3 Pierce Boggan [MSFT] 2017-09-13 20:58:05 UTC
Tentatively moving this feature work to 15.6. We will create an associated work item for tracking in VSTS when we begin work on that milestone.
Comment 4 Pierce Boggan [MSFT] 2017-10-06 01:20:10 UTC
Thanks for taking the time to report this issue. :)

Given this is a feature request or enhancement, I am closing this issue and adding a work item to our backlog.

Note You need to log in before you can comment on or make changes to this bug.