# Mixed file encodings in repos

**URL:** <https://community.sonarsource.com/t/mixed-file-encodings-in-repos/182245>\
**Category:** SonarQube Cloud\
**Tags:** encoding, scanner\
**Created:** [May 12, 2026, 9:12am UTC](https://community.sonarsource.com/t/mixed-file-encodings-in-repos/182245 "2026-05-12T09:12:31Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![milbrandt](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/milbrandt/32/3726_2.png) [@milbrandt](https://community.sonarsource.com/u/milbrandt)\
**Post date:** [May 12, 2026, 9:12am UTC](https://community.sonarsource.com/t/mixed-file-encodings-in-repos/182245/1 "2026-05-12T09:12:31Z")

</div>

- Manual scan from command line
- sonar-scanner-cli-8.0.1.6346-windows-x64
- OpenJDK Runtime Environment Temurin-21.0.11+10 (build 21.0.11+10-LTS)

- Languages of the repository: Legacy repo with VB6, C++, Python, …

- Different file encodings in the repo: ANSI, UTF-8

- Error observed (wrap logs/code around with triple quotes ``` for proper formatting)

- Steps to reproduce  
If needed files with parse errors can be provides as a private message.

- Potential workaround  
For file encoding set `sonar.sourceEncoding=windows-1252` improved as most files are encoded as ANSI

---

<div class="post-metadata">

**Author:** ![ganncamp](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/ganncamp/32/1261_2.png) [@ganncamp](https://community.sonarsource.com/u/ganncamp)\
**Post date:** [May 12, 2026, 1:43pm UTC](https://community.sonarsource.com/t/mixed-file-encodings-in-repos/182245/3 "2026-05-12T13:43:42Z")

</div>

Hi,

Would it be possible for you to provide a reproducer project with a few files with different encoding so that we can see how encoding is declared within the files and what we should be picking up on?

Because yes, our default assumption has always been that all the files in a project will have the same encoding. But you’re not the first person to raise the topic of individual files needing special treatment.

&nbsp;  
Thx,  
Ann

---

<div class="post-metadata">

**Author:** ![milbrandt](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/milbrandt/32/3726_2.png) [@milbrandt](https://community.sonarsource.com/u/milbrandt)\
**Post date:** [May 12, 2026, 3:13pm UTC](https://community.sonarsource.com/t/mixed-file-encodings-in-repos/182245/5 "2026-05-12T15:13:41Z")

</div>

I reduced the repo to 2 subfolders and snt you a private message with the zip. Even in one folder there are .bas files encoded as UTF-8 and ANSI according to Notepad++

Also some of the parse errors I mentioned in the original post are included, I took corresponding folders in the example.

---

<div class="post-metadata">

**Author:** ![ganncamp](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/ganncamp/32/1261_2.png) [@ganncamp](https://community.sonarsource.com/u/ganncamp)\
**Post date:** [May 12, 2026, 4:26pm UTC](https://community.sonarsource.com/t/mixed-file-encodings-in-repos/182245/6 "2026-05-12T16:26:53Z")

</div>

Hi,

Thanks for the reproducer. I’ve flagged this for the team.

&nbsp;  
Ann

---

<div class="post-metadata">

**Author:** ![michal.zgliczynski](https://avatars.discourse-cdn.com/v4/letter/m/898d66/32.png) [@michal.zgliczynski](https://community.sonarsource.com/u/michal.zgliczynski)\
**Post date:** [June 25, 2026, 8:53am UTC](https://community.sonarsource.com/t/mixed-file-encodings-in-repos/182245/11 "2026-06-25T08:53:52Z")

</div>

Replied in the private message.

Otherwise, I’ll re-assign to Joan Biel Tres (our PM) to prioritize if we want to work on repos with multiple encodings.

---

<div class="post-metadata">

**Author:** ![jibiel](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/jibiel/32/69903_2.png) [@jibiel](https://community.sonarsource.com/u/jibiel)\
**Post date:** [July 30, 2026, 1:02pm UTC](https://community.sonarsource.com/t/mixed-file-encodings-in-repos/182245/14 "2026-07-30T13:02:45Z")

</div>

Hi @milbrandt

I am taking note of this request for consideration in our roadmap.

Thanks,

---

<div class="post-metadata">

**Author:** ![milbrandt](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/milbrandt/32/3726_2.png) [@milbrandt](https://community.sonarsource.com/u/milbrandt)\
**Post date:** [July 30, 2026, 4:17pm UTC](https://community.sonarsource.com/t/mixed-file-encodings-in-repos/182245/17 "2026-07-30T16:17:18Z")

</div>

Thanks @jibiel

For the moment I did a `git add --renormalize .` and the build artefact is now at the testers. Hope it will work including UI, but as this old legacy repo has 5.6 MLOC all manual testing will only be a sample.
