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

Add legacy codepage to UTF-8 script #3029

Merged
merged 1 commit into from Oct 21, 2023
Merged

Add legacy codepage to UTF-8 script #3029

merged 1 commit into from Oct 21, 2023

Conversation

rderooy
Copy link
Collaborator

@rderooy rderooy commented Oct 20, 2023

Description

As requested in #3028, the simple script I created to convert files in legacy codepage format to UTF-8.

Related issues

#3028

Manual testing

  • Converted cp437 input file to UTF-8
  • Attempted to convert binary file to UTF-8
  • Attempted to convert file with incorrect codepage

Checklist

I have:

  • followed the project's contributing guidelines and code of conduct.
  • performed a self-review of my code.
  • commented on the particularly hard-to-understand areas of my code.
  • split my work into well-defined, bisectable commits, and I named my commits well.
  • applied the appropriate labels (bug, enhancement, refactoring, documentation, etc.)
  • checked that all my commits can be built.
  • confirmed that my code does not cause performance regressions (e.g., by running the Quake benchmark).
  • added unit tests where applicable to prove the correctness of my code and to avoid future regressions.
  • made corresponding changes to the documentation or the website according to the documentation guidelines.
  • locally verified my website or documentation changes.

@rderooy rderooy added enhancement New feature or enhancement of existing features macOS Issues related to macOS Linux Issues related to GNU/Linux labels Oct 20, 2023
@rderooy rderooy self-assigned this Oct 20, 2023
@rderooy rderooy force-pushed the rdr/cp-to-utf8 branch 2 times, most recently from 8c5ea8c to eb7c003 Compare October 20, 2023 08:23
@rderooy
Copy link
Collaborator Author

rderooy commented Oct 20, 2023

I made a few updates.

  • it now handles things like tilde for the home directory
  • it now handles a few more error cases, like not being able to locate the input file, or some kind of permission error.

@rderooy rderooy force-pushed the rdr/cp-to-utf8 branch 2 times, most recently from 59e9567 to 6e0be61 Compare October 20, 2023 16:41
contrib/scripts/codepage_to_utf8.py Outdated Show resolved Hide resolved
contrib/scripts/codepage_to_utf8.py Show resolved Hide resolved
contrib/scripts/codepage_to_utf8.py Outdated Show resolved Hide resolved
contrib/scripts/codepage_to_utf8.py Outdated Show resolved Hide resolved
contrib/scripts/codepage_to_utf8.py Outdated Show resolved Hide resolved
@OpenRift412
Copy link

Sorry, don't wanna be a bother, but would there perhaps be a way to have it so Staging will call this script during launch to automatically convert any conf files being used by the current instance?

@kcgen
Copy link
Member

kcgen commented Oct 20, 2023

Sorry, don't wanna be a bother, but would there perhaps be a way to have it so Staging will call this script during launch to automatically convert any conf files being used by the current instance?

No; the executable won't be making system-calls or launching scripts from inside the binary. This would be a very presumptive and dirty kludge that would affect everyone just for the sake of the very few would want to specifically convert non-DOSBox-Staging conf files.

If you want to always run this script on every launch, then you can make a wrapper-script that does two things:

  1. Call this conversion script for the given .conf arguments
  2. Launches DOSBox Staging with the converted conf files

@rderooy rderooy force-pushed the rdr/cp-to-utf8 branch 3 times, most recently from 6c341fa to 42c9b09 Compare October 21, 2023 10:12
@kcgen
Copy link
Member

kcgen commented Oct 21, 2023

Looks good, @rderooy 👍

@kcgen kcgen merged commit 3693684 into main Oct 21, 2023
50 checks passed
@kcgen kcgen deleted the rdr/cp-to-utf8 branch October 27, 2023 15:05
@johnnovak johnnovak added the localisation Issues related to localisation and internationalisation label Dec 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or enhancement of existing features Linux Issues related to GNU/Linux localisation Issues related to localisation and internationalisation macOS Issues related to macOS
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

5 participants