Skip to content

Commit

Permalink
fix: use ut8 encoding for config and filenames
Browse files Browse the repository at this point in the history
Config values can now carry non-ascii values. This required also configuring
allegro to treat file paths as UTF8.

Fonts have varying support for characters outside ASCII characters.
Probably we currently have no fonts that adequately cover non-latin
characters. While you may see gibberish in the file picker, files should
still load just fine.
  • Loading branch information
connorjclark committed Aug 8, 2023
1 parent 2da41aa commit 134c2fd
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 11 deletions.
2 changes: 1 addition & 1 deletion allegro-legacy/src/file.c
Expand Up @@ -77,7 +77,7 @@ static PACKFILE_VTABLE normal_vtable;

static PACKFILE *pack_fopen_special_file(AL_CONST char *filename, AL_CONST char *mode);

static int filename_encoding = U_ASCII;
static int filename_encoding = U_UTF8;


#define FA_DAT_FLAGS (FA_RDONLY | FA_ARCH)
Expand Down
1 change: 0 additions & 1 deletion src/launcher/launcher.cpp
Expand Up @@ -84,7 +84,6 @@ int32_t main(int32_t argc, char* argv[])
{
common_main_setup(App::launcher, argc, argv);

set_uformat(U_ASCII);
zc_srand(time(0));


Expand Down
4 changes: 0 additions & 4 deletions src/zc/title.cpp
Expand Up @@ -671,8 +671,6 @@ static void DX_mainscreen(int32_t f)
FFCore.skip_ending_credits = 0;
for ( int32_t q = 0; q < 256; q++ ) runningItemScripts[q] = 0; //Clear scripts that were running before.

set_uformat(U_ASCII);

static int32_t pic=0;
//char tbuf[80];
char tbuf[2048] = {0}; char tbuf2[2048] = {0};
Expand Down Expand Up @@ -895,8 +893,6 @@ static void v25_mainscreen(int32_t f)
FFCore.skip_ending_credits = 0;
for ( int32_t q = 0; q < 256; q++ ) runningItemScripts[q] = 0; //Clear scripts that were running before.

set_uformat(U_ASCII);

static int32_t pic=0;
//char tbuf[80];
char tbuf[2048] = {0}; char tbuf2[2048] = {0};
Expand Down
2 changes: 0 additions & 2 deletions src/zc/zelda.cpp
Expand Up @@ -4795,8 +4795,6 @@ int main(int argc, char **argv)

mididata = (DATAFILE*)datafile[ZC_MIDI].dat;

set_uformat(U_ASCII);

allocate_crap();

//script drawing bitmap allocation
Expand Down
3 changes: 0 additions & 3 deletions src/zq/zquest.cpp
Expand Up @@ -28808,9 +28808,6 @@ int32_t main(int32_t argc,char **argv)


zc_srand(time(0));


set_uformat(U_ASCII);

Z_message("Initializing Allegro... ");
if(!al_init())
Expand Down

0 comments on commit 134c2fd

Please sign in to comment.