Skip to content

Fix DGS import issue with BOM#3864

Merged
olperr1 merged 4 commits intomainfrom
dgs_import_bom_issue
Apr 13, 2026
Merged

Fix DGS import issue with BOM#3864
olperr1 merged 4 commits intomainfrom
dgs_import_bom_issue

Conversation

@geofjamg
Copy link
Copy Markdown
Member

@geofjamg geofjamg commented Apr 7, 2026

Please check if the PR fulfills these requirements

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • A PR or issue has been opened in all impacted repositories (if any)

Does this PR already have an issue describing the problem?

No

What kind of change does this PR introduce?

Bug fix

What is the current behavior?

DGS import fails when file starts with a BOM

What is the new behavior (if this is a feature change)?
DGS import is robust to BOM

Does this PR introduce a breaking change or deprecate an API?

  • Yes
  • No

If yes, please check if the following requirements are fulfilled

  • The Breaking Change or Deprecated label has been added
  • The migration steps are described in the following section

What changes might users need to make in their application due to this PR? (migration steps)

Other information:

Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@rte-france.com>
@alicecaron alicecaron moved this from TODO to Waiting for review in Release 06/2026 Apr 7, 2026
@zamarrenolm
Copy link
Copy Markdown
Member

zamarrenolm commented Apr 10, 2026

When the branch is checkout locally (either on MacOS or in Windows) the test file BOMTest.dgs does not contain the BOM:

test/resources % hexdump -C BOMTest.dgs
00000000  24 24 47 65 6e 65 72 61  6c 3b 49 44 28 61 3a 34  |$$General;ID(a:4|
00000010  30 29 3b 44 65 73 63 72  28 61 3a 34 30 29 3b 56  |0);Descr(a:40);V|
00000020  61 6c 28 61 3a 34 30 29  0a 20 31 3b 56 65 72 73  |al(a:40). 1;Vers|
00000030  69 6f 6e 3b 35 2e 30 0a                           |ion;5.0.|
00000038

Maybe it has been lost when pushing your local changes or checking out text files from github ?.

Anyway, we have tested the change with a modified text file that has the BOM bytes and it works.

We have verified that github does not modify a text file that does contain the BOM bytes. We have pushed the branch dgs_import_bom_issue_test_bom_uploaded in case you want to use it (the ony difference with your original branch is the BOMTest.dgs file)

@rolnico rolnico self-requested a review April 10, 2026 07:38
Signed-off-by: Nicolas Rol <nicolas.rol@rte-france.com>
@rolnico rolnico requested review from zamarrenolm and removed request for rolnico April 10, 2026 07:55
@rolnico
Copy link
Copy Markdown
Member

rolnico commented Apr 10, 2026

When the branch is checkout locally (either on MacOS or in Windows) the test file BOMTest.dgs does not contain the BOM:

test/resources % hexdump -C BOMTest.dgs
00000000  24 24 47 65 6e 65 72 61  6c 3b 49 44 28 61 3a 34  |$$General;ID(a:4|
00000010  30 29 3b 44 65 73 63 72  28 61 3a 34 30 29 3b 56  |0);Descr(a:40);V|
00000020  61 6c 28 61 3a 34 30 29  0a 20 31 3b 56 65 72 73  |al(a:40). 1;Vers|
00000030  69 6f 6e 3b 35 2e 30 0a                           |ion;5.0.|
00000038

Maybe it has been lost when pushing your local changes or checking out text files from github ?.

Anyway, we have tested the change with a modified text file that has the BOM bytes and it works.

We have verified that github does not modify a text file that does contain the BOM bytes. We have pushed the branch dgs_import_bom_issue_test_bom_uploaded in case you want to use it (the ony difference with your original branch is the BOMTest.dgs file)

It should be fixed now

@geofjamg
Copy link
Copy Markdown
Member Author

When the branch is checkout locally (either on MacOS or in Windows) the test file BOMTest.dgs does not contain the BOM:

test/resources % hexdump -C BOMTest.dgs
00000000  24 24 47 65 6e 65 72 61  6c 3b 49 44 28 61 3a 34  |$$General;ID(a:4|
00000010  30 29 3b 44 65 73 63 72  28 61 3a 34 30 29 3b 56  |0);Descr(a:40);V|
00000020  61 6c 28 61 3a 34 30 29  0a 20 31 3b 56 65 72 73  |al(a:40). 1;Vers|
00000030  69 6f 6e 3b 35 2e 30 0a                           |ion;5.0.|
00000038

Maybe it has been lost when pushing your local changes or checking out text files from github ?.
Anyway, we have tested the change with a modified text file that has the BOM bytes and it works.
We have verified that github does not modify a text file that does contain the BOM bytes. We have pushed the branch dgs_import_bom_issue_test_bom_uploaded in case you want to use it (the ony difference with your original branch is the BOMTest.dgs file)

It should be fixed now

Thanks!

@github-project-automation github-project-automation bot moved this from Waiting for review to Approved in Release 06/2026 Apr 10, 2026
@sonarqubecloud
Copy link
Copy Markdown

@olperr1 olperr1 merged commit 491b3f8 into main Apr 13, 2026
7 checks passed
@olperr1 olperr1 deleted the dgs_import_bom_issue branch April 13, 2026 06:40
@github-project-automation github-project-automation bot moved this from Approved to Done in Release 06/2026 Apr 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants