Skip to content

Rework AUTOEXEC.BAT support, make it UTF-8 aware #2425

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

Merged
merged 1 commit into from
Apr 26, 2023
Merged

Rework AUTOEXEC.BAT support, make it UTF-8 aware #2425

merged 1 commit into from
Apr 26, 2023

Conversation

FeralChild64
Copy link
Collaborator

  1. Moved AUTOEXEC.BAT support to a separate file, reworked the code to use modern C++ features
  2. The generated Z:\AUTOEXEC.BAT should be more aesthetic now
  3. [autoexec] section is now UTF-8 aware

NOTE: This PR will need a small (trivial) adaptation after #2422 is merged, due to renamed UTF8_GetCodePage and UTF8_RenderForDos. When both are merged, the autoexec-related problems mentioned on Discord by @dreamer should be resolved.


A quick&dirty test - open dosbox-staging.conf in your favorite editor, add the following lines to the [autoexec] section, and save it as UTF-8 file (this is crucial!):

@ECHO.
@Z:\KEYB.COM us 437 > NUL
@ECHO  KEYB us 437  : ĄĘŁĆŃÓŚŹŻ
@ECHO.
@Z:\KEYB.COM lv 1117 > NUL
@ECHO  KEYB lv 1117 : ĄĘŁĆŃÓŚŹŻ
@ECHO.
@Z:\KEYB.COM pl 667 > NUL
@ECHO  KEYB pl 667  : ĄĘŁĆŃÓŚŹŻ
@ECHO.
@Z:\KEYB.COM pl 668 > NUL
@ECHO  KEYB pl 668  : ĄĘŁĆŃÓŚŹŻ
@ECHO.

Afterwards:

  1. Start DOSBox and check (using KEYB commands above) that it printed out the text according to the code page set at given moment.
  2. Switch between different code pages and type type Z:\AUTOEXEC.BAT commands - check that DOSBox always adapts the content of the AUTOEXEC.BAT to the currently active code page.

@FeralChild64 FeralChild64 force-pushed the fc/autoexec-1 branch 3 times, most recently from 02f3c33 to 0ddec11 Compare April 21, 2023 18:59
@FeralChild64 FeralChild64 changed the title Reworked AUTOEXEC.BAT support, made it UTF-8 aware Rework AUTOEXEC.BAT support, make it UTF-8 aware Apr 21, 2023
@FeralChild64 FeralChild64 self-assigned this Apr 21, 2023
@FeralChild64 FeralChild64 added the enhancement New feature or enhancement of existing features label Apr 21, 2023
@FeralChild64 FeralChild64 marked this pull request as ready for review April 21, 2023 19:00
@FeralChild64 FeralChild64 force-pushed the fc/autoexec-1 branch 2 times, most recently from 6bc6364 to 24706d1 Compare April 22, 2023 20:04
@kcgen
Copy link
Member

kcgen commented Apr 22, 2023

@FeralChild64 , thanks for the sample testing code. Working good here, and with other attempts to exercise it.

@FeralChild64 FeralChild64 force-pushed the fc/autoexec-1 branch 3 times, most recently from d24f57b to 17c36ea Compare April 23, 2023 14:30
@FeralChild64 FeralChild64 marked this pull request as draft April 23, 2023 16:55
@FeralChild64
Copy link
Collaborator Author

Back to draft, after handling most of the review remarks I need to re-check and cleanup the implementation.

@FeralChild64 FeralChild64 force-pushed the fc/autoexec-1 branch 3 times, most recently from 353ce31 to f9a7411 Compare April 24, 2023 16:17
@FeralChild64 FeralChild64 marked this pull request as ready for review April 24, 2023 17:05
@FeralChild64 FeralChild64 requested a review from johnnovak April 24, 2023 17:05
@FeralChild64 FeralChild64 force-pushed the fc/autoexec-1 branch 4 times, most recently from 5be7260 to 9d137c5 Compare April 25, 2023 17:19
Copy link
Member

@kcgen kcgen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another big overhaul of the previously convoluted shell handling; thanks @FeralChild64 ! All comments addressed - let's merge.

@kcgen kcgen merged commit f466410 into main Apr 26, 2023
@FeralChild64 FeralChild64 deleted the fc/autoexec-1 branch April 30, 2023 04:22
@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 localisation Issues related to localisation and internationalisation
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants