0

I'm having issues with DevOps using Windows cp1252 file encoding rather than UTF-8 for repositories, resulting in my code breaking. I have certain symbols that are only supported by the UTF-8 format and have not found a possible way to change how I am pushing to the repository, and have no other alternative options to Azure DevOps as a platform just because of the mess that is JetBrains Space, and how there are utterly no other services offering the same concepts / platform for me (features like boards, the integrated CI, I just like having everything in one place and this is the only possible platform I have found, so don't link me elsewhere unless it actually meets the proper requirements.

Build log (custom Maven-based build environment)
 9122  [WARNING]
 9123      rip.verse.vserver.commands.implementations.VersionCommand [22,36]
 9124      unmappable character (0x95) for encoding UTF-8
VersionCommand.java
 19  public boolean execute(Sender sender, String[] arguments) {
 20      if (arguments.legnth == 0) {
 21          // ...
 22          sender.sendTranslatedMessage("&8� &7Version: &b1.0");
 23          // ...
 24          return true;
 25      }
 26  }
GameGlitz
  • 1
  • 1
  • 1

1 Answers1

1

I found the similar issue reported in DeveoperCommunity forum, and the product group gave the following answer.

This is by design. Editing a file (in Git) in the VSTS Code hub will save that file as UTF-8. This behavior was selected since UTF-8 is ubiquitously used, the encoding can be accurately determined, and it can encode all the special characters of the various flavors of ANSI as well as other languages. Of course, this might present a problem if you're specifically expecting special characters with Win 1252 (or other) encoding in another application or particular purpose, and if that's the case then you'll want to avoid editing in the web UI. I'm curious to know if that's the case, but I would personally recommend eventually using UTF-8 if possible to avoid encoding issues of the past.

Therefore, Windows cp1252 file encoding is not supported in Azure Repository, you need to save your file using UTF-8 file encoding. Please review this blog: How TFS Version Control determines a file’s encoding and What is the default encoding for source files in Visual Studio 2017? if you use Visual Studio.

Edward Han-MSFT
  • 2,879
  • 1
  • 4
  • 9
  • The problem that I'm having is that I want to use UTF-8 but it's defaulting to cp1252 instead. I have no idea why it is doing this but it's weird since everywhere I look this isn't even supported behavior. – GameGlitz Apr 19 '21 at 18:56
  • How do you edit and save your repository? If you use Visual Studio, I found this thread: https://stackoverflow.com/questions/41335199/how-to-config-visual-studio-to-use-utf-8-as-the-default-encoding-for-all-project, you could review it. – Edward Han-MSFT Apr 20 '21 at 07:11
  • I personally just use the Git CLI to save to my repository, and IntelliJ is my IDE of choice, which reads configuration data for file encoding from the build file itself (in my case, Maven POMs) to define what encoding I use, which is set to UTF-8. Loading a file would result in the IDE complain about me using the wrong encoding in my Maven POM and I should reload the file with cp1252 or set it in my POM. – GameGlitz Apr 20 '21 at 18:58
  • I am Azure DevOps support engineer but not expert in file encoding, so I would suggest that you describe your issue with detailed information and tag your issue with related IDE, and maven, so related experts will review your issue and provide professional solutions. Thanks. – Edward Han-MSFT Apr 21 '21 at 01:41