X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=libpcsxcore%2Fcdriso.c;h=c36c196120328971743cda36c2e9b4d3a830932f;hb=270c6dd14f876b8a67929aa22abefc47f4588324;hp=9e70ddf07bb14006869697511dc4f74077c3ba97;hpb=3993490baa28964c5e3e8f879b58147184d9b0f7;p=pcsx_rearmed.git diff --git a/libpcsxcore/cdriso.c b/libpcsxcore/cdriso.c index 9e70ddf0..c36c1961 100644 --- a/libpcsxcore/cdriso.c +++ b/libpcsxcore/cdriso.c @@ -19,6 +19,8 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * ***************************************************************************/ +#include + #include "psxcommon.h" #include "plugins.h" #include "cdrom.h" @@ -334,16 +336,16 @@ static int parsetoc(const char *isofile) { return -1; } - if ((fi = fopen(tocname, "r")) == NULL) { + if ((fi = fopen_utf8(tocname, "r")) == NULL) { // try changing extension to .cue (to satisfy some stupid tutorials) strcpy(tocname + strlen(tocname) - 4, ".cue"); - if ((fi = fopen(tocname, "r")) == NULL) { + if ((fi = fopen_utf8(tocname, "r")) == NULL) { // if filename is image.toc.bin, try removing .bin (for Brasero) strcpy(tocname, isofile); t = strlen(tocname); if (t >= 8 && strcmp(tocname + t - 8, ".toc.bin") == 0) { tocname[t - 4] = '\0'; - if ((fi = fopen(tocname, "r")) == NULL) { + if ((fi = fopen_utf8(tocname, "r")) == NULL) { return -1; } } @@ -486,7 +488,7 @@ static int parsecue(const char *isofile) { return -1; } - if ((fi = fopen(cuename, "r")) == NULL) { + if ((fi = fopen_utf8(cuename, "r")) == NULL) { return -1; } @@ -590,7 +592,7 @@ static int parsecue(const char *isofile) { else tmp = tmpb; strncpy(incue_fname, tmp, incue_max_len); - ti[numtracks + 1].handle = fopen(filepath, "rb"); + ti[numtracks + 1].handle = fopen_utf8(filepath, "rb"); // update global offset if this is not first file in this .cue if (numtracks + 1 > 1) { @@ -611,7 +613,7 @@ static int parsecue(const char *isofile) { strncasecmp(isofile + strlen(isofile) - 4, ".cd", 3) == 0)) { // user selected .cue/.cdX as image file, use it's data track instead fclose(cdHandle); - cdHandle = fopen(filepath, "rb"); + cdHandle = fopen_utf8(filepath, "rb"); } } } @@ -645,7 +647,7 @@ static int parseccd(const char *isofile) { return -1; } - if ((fi = fopen(ccdname, "r")) == NULL) { + if ((fi = fopen_utf8(ccdname, "r")) == NULL) { return -1; } @@ -704,7 +706,7 @@ static int parsemds(const char *isofile) { return -1; } - if ((fi = fopen(mdsname, "rb")) == NULL) { + if ((fi = fopen_utf8(mdsname, "rb")) == NULL) { return -1; } @@ -1144,7 +1146,7 @@ static int opensubfile(const char *isoname) { return -1; } - subHandle = fopen(subname, "rb"); + subHandle = fopen_utf8(subname, "rb"); if (subHandle == NULL) { return -1; } @@ -1623,7 +1625,7 @@ static long CALLBACK ISOopen(void) { return 0; // it's already open } - cdHandle = fopen(GetIsoFile(), "rb"); + cdHandle = fopen_utf8(GetIsoFile(), "rb"); if (cdHandle == NULL) { SysPrintf(_("Could't open '%s' for reading: %s\n"), GetIsoFile(), strerror(errno)); @@ -1695,7 +1697,7 @@ static long CALLBACK ISOopen(void) { p = alt_bin_filename + strlen(alt_bin_filename) - 4; for (i = 0; i < sizeof(exts) / sizeof(exts[0]); i++) { strcpy(p, exts[i]); - tmpf = fopen(alt_bin_filename, "rb"); + tmpf = fopen_utf8(alt_bin_filename, "rb"); if (tmpf != NULL) break; } @@ -1731,7 +1733,7 @@ static long CALLBACK ISOopen(void) { // make sure we have another handle open for cdda if (numtracks > 1 && ti[1].handle == NULL) { - ti[1].handle = fopen(bin_filename, "rb"); + ti[1].handle = fopen_utf8(bin_filename, "rb"); } cdda_cur_sector = 0; cdda_file_offset = 0;