1 diff -u mythes/mythes.cxx build/mythes/mythes.cxx
2 --- mythes/mythes.cxx 2014-05-22 00:27:38.508588487 +0200
3 +++ build/mythes/mythes.cxx 2014-05-22 10:07:06.107547417 +0200
13 MyThes::MyThes(const char* idxpath, const char * datpath)
19 // open the index file
20 - FILE * pifile = fopen(idxpath,"r");
21 + FILE * pifile = myfopen(idxpath,"r");
28 /* next open the data file */
29 - pdfile = fopen(datpath,"r");
30 + pdfile = myfopen(datpath,"r");
38 +FILE * MyThes::myfopen(const char * path, const char * mode) {
40 +#define WIN32_LONG_PATH_PREFIX "\\\\?\\"
41 + if (strncmp(path, WIN32_LONG_PATH_PREFIX, 4) == 0) {
42 + int len = MultiByteToWideChar(CP_UTF8, 0, path, -1, NULL, 0);
43 + wchar_t *buff = (wchar_t *) malloc(len * sizeof(wchar_t));
44 + wchar_t *buff2 = (wchar_t *) malloc(len * sizeof(wchar_t));
46 + MultiByteToWideChar(CP_UTF8, 0, path, -1, buff, len);
47 + if (_wfullpath( buff2, buff, len ) != NULL) {
48 + f = _wfopen(buff2, (strcmp(mode, "r") == 0) ? L"r" : L"rb");
55 + return fopen(path, mode);
57 diff -u mythes/mythes.hxx build/mythes/mythes.hxx
58 --- mythes/mythes.hxx 2010-03-04 12:56:23.000000000 +0100
59 +++ build/mythes/mythes.hxx 2014-05-22 10:11:14.363543731 +0200
61 MyThes & operator = (const MyThes &);
64 + // use UTF-8 encoded paths in WIN32 environment
65 MyThes(const char* idxpath, const char* datpath);
69 // return index of char in string
70 int mystr_indexOfChar(const char * d, int c);
73 + FILE * myfopen(const char * path, const char * mode);