1

With this code I'm able to process any file, except for those that contain "special" characters such as accented letters (à, è, ì, ò, ù ...) and the letters of oriental alphabets

setlocale(LC_ALL, ".65001");
FILE* F=fopen("Example.ogg", "rb");

As I wrote above, the problem occurs when instead of "Example.ogg" I insert a file, for example, called "Exàmple.ogg" or "究 極 の 聖 戦 バ ト .ogg". With such examples, it is as if he cannot open the file. I searched the web for a long time for a solution, but found nothing.

Can you help me?

Thanks in advance

user3204810
  • 323
  • 6
  • 16
  • 3
    Have you tried using wide characters? Like: `FILE* F=wfopen(L"Exàmple.ogg", L"rb");` (could be `_wfopen` on Windows/MSVC). – Adrian Mole Jan 06 '20 at 09:58
  • I'm working wih MinGW: `FILE* F=fopen(L"Exàmple.ogg", L"rb")` returns this error message: `error: no matching function for call to 'fopen' stdio.h:600:17: note: candidate function not viable: no known conversion from 'const wchar_t [3]' to 'const char *__restrict' for 2nd argumen` – user3204810 Jan 06 '20 at 10:02
  • 2
    You need to change `fopen` to `wfopen` to take the `wchar_t` arguments. – Adrian Mole Jan 06 '20 at 10:04
  • Please, try [google "std::fopen wide char"](https://www.google.com/search?q=std%3A%3Afopen+wide+characters) to find more about this. – Scheff's Cat Jan 06 '20 at 10:12

0 Answers0