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

Windows: Tilesets with accents in the path cannot be used #565

Closed
lmoureaux opened this issue Jul 26, 2021 · 7 comments · Fixed by #2146
Closed

Windows: Tilesets with accents in the path cannot be used #565

lmoureaux opened this issue Jul 26, 2021 · 7 comments · Fixed by #2146
Labels
bug Something isn't working gui This issue requires changes to the user interface

Comments

@lmoureaux
Copy link
Contributor

Describe the bug

According to kevin551, after downloading Aviation using the Modpack installer on Windows the tileset is not found by the client.

To Reproduce
Steps to reproduce the behavior:

  1. Start the client, connect to LTEx24
  2. Install Aviation from the Modpack installer
  3. Try to switch to the Aviation tileset

Expected behavior

Aviation is visible in every possible tileset selection option.

Platform and version (please complete the following information):

  • OS: Windows (10?)
  • Freeciv21 version: 3.0-alpha3
  • Ruleset/Longturn game (if applicable): LTEx24
@lmoureaux lmoureaux added bug Something isn't working Untriaged This issue or PR needs triaging gui This issue requires changes to the user interface labels Jul 26, 2021
@jwrober
Copy link
Collaborator

jwrober commented Jul 26, 2021

On Windows, the modpack installer places the files into C:\Users\<UserID>\AppData\Roaming\freeciv21\3.0. If you are in a game with the client open when you download something with the modpack installer the client is not aware of the change until you exit the game/close the client and then re-open and connect to a game again. It is the same behavior as any client in classic freeciv.

@lmoureaux
Copy link
Contributor Author

If it's not refreshed automatically, we need a refresh button 😅

@jwrober
Copy link
Collaborator

jwrober commented Jul 26, 2021

Behavior is the same on Linux so a refresh option makes sense.

@lmoureaux lmoureaux removed the Untriaged This issue or PR needs triaging label Jul 26, 2021
@lmoureaux
Copy link
Contributor Author

Tested on Windows, for me everything was up-to-date after installing without restarting the client. Maybe one needs to reopen the settings window.

However, selecting aviation in the settings didn't work and I had to use the "Choose another tileset" menu.

@lmoureaux
Copy link
Contributor Author

However, selecting aviation in the settings didn't work and I had to use the "Choose another tileset" menu.

--> #740

This is just about a refresh button, not for beta1

@lmoureaux lmoureaux removed this from the v3.0-beta.1 milestone Nov 21, 2021
@jwrober jwrober added this to the v3.0-beta.2 milestone Jan 25, 2022
@jwrober jwrober removed this from the v3.0-beta.2 milestone Apr 6, 2022
@lmoureaux
Copy link
Contributor Author

lmoureaux commented Jan 7, 2024

This issue happened for the SG2 game. It is heavily user-dependent. I was able to reproduce it on wine with 3.0-patch.2:

This is Freeciv21 version 3.0.16116404.2-patch.
Built against Qt 5.15.11, using 5.15.11

This instance of Freeciv21 searches the following directories for data files:

* Z:/home (user)
* Z:/home/louis (does not exist)
* C:/users/louis/Application Data/freeciv21/3.0 (user)
* D:/a/freeciv21/freeciv21/build/install/data (does not exist)
* C:/users/louis/Local Settings/Application Data/freeciv21 (does not exist)
* C:/ProgramData/freeciv21 (does not exist)
* Z:/home/louis/.wine/drive_c/Program Files/Freeciv21 (user)
* Z:/home/louis/.wine/drive_c/Program Files/Freeciv21/data (user)
* Z:/home/louis/.wine/drive_c/Program Files/Freeciv21/data/freeciv21 (does not exist)

@lmoureaux
Copy link
Contributor Author

lmoureaux commented Jan 7, 2024

I can reproduce on Wine. The trick is to add a non-ASCII character somewhere in the tileset path. For instance, a tileset called é won't be found.

lmoureaux added a commit to lmoureaux/freeciv21 that referenced this issue Jan 7, 2024
This prevents encoding issues.

Closes longturn#565.
lmoureaux added a commit to lmoureaux/freeciv21 that referenced this issue Jan 7, 2024
Use QFileInfo. This removes the need to encode the file name in the system
locale by hand.

See longturn#565.
lmoureaux added a commit to lmoureaux/freeciv21 that referenced this issue Jan 7, 2024
QFile() provides an API that doesn't require dangerous explicit encoding
conversions.

See longturn#565.
lmoureaux added a commit to lmoureaux/freeciv21 that referenced this issue Jan 7, 2024
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.
@lmoureaux lmoureaux changed the title The client might not find tilesets installed from the modpack installer Windows: Tilesets with accents in the path cannot be used Jan 8, 2024
lmoureaux added a commit to lmoureaux/freeciv21 that referenced this issue Jan 8, 2024
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.
lmoureaux added a commit to lmoureaux/freeciv21 that referenced this issue Jan 8, 2024
This prevents encoding issues.

See longturn#565.
lmoureaux added a commit to lmoureaux/freeciv21 that referenced this issue Jan 8, 2024
Use QFileInfo. This removes the need to encode the file name in the system
locale by hand.

See longturn#565.
lmoureaux added a commit to lmoureaux/freeciv21 that referenced this issue Jan 8, 2024
QFile() provides an API that doesn't require dangerous explicit encoding
conversions.

See longturn#565.
lmoureaux added a commit to lmoureaux/freeciv21 that referenced this issue Jan 8, 2024
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.
@jwrober jwrober closed this as completed in 6689c54 Jan 8, 2024
lmoureaux added a commit that referenced this issue Jan 20, 2024
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 #565.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working gui This issue requires changes to the user interface
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants