Skip to content

Improve charset selection when parsing Delphi source files#447

Merged
fourls merged 1 commit into
masterfrom
improved-charset-selection
Jun 3, 2026
Merged

Improve charset selection when parsing Delphi source files#447
fourls merged 1 commit into
masterfrom
improved-charset-selection

Conversation

@cirras

@cirras cirras commented Jun 3, 2026

Copy link
Copy Markdown
Collaborator

The preference order is now:

  • Charset detected by sonar-scanner (applies only to InputFile)
  • Charset detected from BOM
  • Charset provided by sonar.sourceEncoding
  • ANSI charset specified by sonar.delphi.codePage
  • ANSI charset specified by DCC_Codepage
  • System native charset

And just to muddy up the changeset a bit, I've refactored raw "encoding" strings to Charset,

Fixes #439.

@cirras cirras requested a review from fourls June 3, 2026 06:29

@fourls fourls left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@fourls fourls left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually - needs a changelog entry.

The preference order is now:
- Charset detected by `sonar-scanner` (applies only to `InputFile`)
- Charset detected from BOM
- Charset provided by `sonar.sourceEncoding`
- ANSI charset specified by `sonar.delphi.codePage`
- ANSI charset specified by `DCC_Codepage`
- System native charset
@cirras cirras force-pushed the improved-charset-selection branch from 6eb6ee9 to 758ddb5 Compare June 3, 2026 07:52
@cirras cirras requested a review from fourls June 3, 2026 07:52

@fourls fourls left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good for real!

@fourls fourls merged commit 6b464b3 into master Jun 3, 2026
4 checks passed
@fourls fourls deleted the improved-charset-selection branch June 3, 2026 08:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

sonar.sourceEncoding is not applied to UnitSearchPath

2 participants