Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor encodings #2145

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft

Conversation

lmoureaux
Copy link
Contributor

This PR tries to sanitize the handling of character encodings:

Checks

I checked the following under wine for files with accents in the name:

  • Reading serv files (from the server prompt, with the -r option, and from the client)
  • Finding tilespec file
  • Handling UTF-8 ruleset files (Royale's Ħal Saflieni Hypogeum)

I couldn't check the following because the file names don't have accents in my setup:

  • Removing the test file used for cmdlevel hack
  • Finding and using the client settings file and modpack DB

There was an encoding issue in fileinfoname() that prevented finding files with
special characters in the path (fc_stat would fail). Rewrite it using Qt APIs
only.

Closes longturn#565.
This prevents encoding issues.

See longturn#565.
Use QFileInfo. This removes the need to encode the file name in the system
locale by hand.

See longturn#565.
QFile() provides an API that doesn't require dangerous explicit encoding
conversions.

See longturn#565.
We need only two character encodings: whatever the local 8-bits encoding is and
UTF-8. QString provides native conversion between those so we don't need
anything of our own.

This also fully removes traces of past support for custom internal and data
encodings -- why would anyone want this now that UTF-8 has finally taken over
the world?

See longturn#565.
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.

1 participant