Comment 13 for bug 678808

Revision history for this message
nobody (nobody-users) wrote :

Logged In: NO

I did some more testing on a Windows XP machine set to Russian encoding:
(Control panel/Advanced) Language for non-unicode programs: Russian
using the simple program below, and it works nicely with russian filenames when compiled with MSVC 2003 (can open the file with both fopen and std::ifstream), but the MSVC 2008 executable fails to open the files using std::ifstream (fopen still works). Looks like a bug in MSVC 2008.

Unfortunately I can't build the windows version with MSVC 2003 right now, as CMake refuses to work properly on the machine I have installed MSVC 2003. Additionally I'll have to recompile most dependencies with MSVC 2003 again first (which is a major pain in the ass!).

Here is the simple test program to reproduce the bug:

#include <fstream>
#include <stdio.h>

int main(int argc, char * argv[])
{
 char * filename = argv[1];
 printf("Trying to open file %s\n", filename);
 FILE * f = fopen(filename,"rb");
 if (f) {
    printf("OK: fopen %s worked\n", filename);
    fclose(f);
 } else {
    perror("fopen failed");
 }

 std::ifstream fin2(filename, std::ios::binary);
 if (!fin2.good()) {
  printf("FAILED: std::ifstream in binary mode\n");
 } else {
  printf("OK: std::ifstream in binary mode\n");
 }
}