I
I
IvankoPo2018-04-21 00:03:09
C++ / C#
IvankoPo, 2018-04-21 00:03:09

How to open a file whose name is represented in unicode?

In the command line arguments, the path to the text file, it must be read. If the file name is written in English, then everything works, but if the path is like this

C:\Users\user\Documents\VisualStudio2015\Projects\app1\app1\विकिपीडिया.mht

then the file is not opened.
Suggest your solution, it is important that the file is read using the FILE structure and the fopen() function.
My code.
int main(int argc, char* argv[])
{
  FILE *f = nullptr;
  f = fopen(argv[1], "r");
  if (f != NULL) {
    std::cout << "succses" << std::endl;
  }
  fclose(f);

    return 0;
}

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question