Skip to content

Conversation

SadPencil
Copy link
Member

@SadPencil SadPencil commented May 29, 2025

The cause of this bug:

  • the spawnmap.ini file is written in the same encoding with mapIni.Encoding
  • UDE returns "UTF-8" as a string. Encoding.GetEncoding("UTF-8") will return UTF-8 with BOM

This PR can be regarded as a partial revert of the last UDE PR #704:

  • only invokes UDE to guess the encoding if it's TS, and the answer is accepted only if UDE has > 50% confidence. The UTF-8 without BOM encoding will be selected if the detected encoding is UTF-8 or ASCII
  • let UDE guess the encoding on map codes (I think they are missed in the last UDE PR Fix spawnmap.ini encoding getting messed up #704)

In other words, this PR revert the last UDE PR to the original behavior, unless it's a TS game and the UDE is confident and the detected encoding is an encoding that the original client won't correctly handle

Copy link

github-actions bot commented May 29, 2025

Nightly build for this pull request:

  • artifacts.zip
    This comment is automatic and is meant to allow guests to get latest automatic builds without registering. It is updated on every successful build.

@SadPencil SadPencil force-pushed the fix-spawnini-encoding branch from 4f5711c to 3085377 Compare May 29, 2025 14:25
@SadPencil SadPencil changed the title Fix UTF-8 BOM is introduced in the generated spawnmap.ini file Fix UTF-8 with BOM is introduced in the generated spawnmap.ini file May 29, 2025
@SadPencil
Copy link
Member Author

@MahBoiDeveloper any comments on this PR?

@SadPencil SadPencil requested a review from Metadorius May 31, 2025 11:39
@SadPencil SadPencil merged commit 2373f7c into CnCNet:develop May 31, 2025
1 check passed
@SadPencil SadPencil deleted the fix-spawnini-encoding branch May 31, 2025 21:11
SadPencil added a commit to SadPencil/xna-cncnet-client that referenced this pull request Jun 28, 2025
…CnCNet#738)

* Fix UTF-8 BOM is introduced in the generated spawnmap.ini file

* Provide UTF-8 without BOM encoding into EncodingExt class
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.

3 participants