<commit_before>diff -ru hunspell/src/hunspell/csutil.cxx build/hunspell/src/hunspell/csutil.cxx
--- hunspell/src/hunspell/csutil.cxx	2011-02-02 11:35:43.000000000 +0100
+++ build/hunspell/src/hunspell/csutil.cxx	2014-04-24 19:42:01.373285409 +0200
@@ -17,6 +17,10 @@
   unsigned short clower;
 };
 
+#ifdef _WIN32
+#include <wchar.h>
+#endif
+
 #ifdef OPENOFFICEORG
 #  include <unicode/uchar.h>
 #else
@@ -46,6 +50,21 @@
 static struct unicode_info2 * utf_tbl = NULL;
 static int utf_tbl_count = 0; // utf_tbl can be used by multiple Hunspell instances
 
+FILE * myfopen(const char * path, const char * mode) {
+#ifdef _WIN32
+#define WIN32_LONG_PATH_PREFIX "\\\\?\\"
+    if (strncmp(path, WIN32_LONG_PATH_PREFIX, 4) == 0) {
+        int len = MultiByteToWideChar(CP_UTF8, 0, path, -1, NULL, 0);
+        wchar_t *buff = (wchar_t *) malloc(len * sizeof(wchar_t));
+        MultiByteToWideChar(CP_UTF8, 0, path, -1, buff, len);
+        FILE * f = _wfopen(buff, (strcmp(mode, "r") == 0) ? L"r" : L"rb");
+        free(buff);
+        return f;
+    }
+#endif
+    return fopen(path, mode);
+}
+
 /* only UTF-16 (BMP) implementation */
 char * u16_u8(char * dest, int size, const w_char * src, int srclen) {
     signed char * u8 = (signed char *)dest;
diff -ru hunspell/src/hunspell/csutil.hxx build/hunspell/src/hunspell/csutil.hxx
--- hunspell/src/hunspell/csutil.hxx	2010-09-06 09:58:53.000000000 +0200<commit_msg>try including windows.h for MultiByteToWideChar<commit_after>diff -ru hunspell/src/hunspell/csutil.cxx build/hunspell/src/hunspell/csutil.cxx
--- hunspell/src/hunspell/csutil.cxx	2011-02-02 11:35:43.000000000 +0100
+++ build/hunspell/src/hunspell/csutil.cxx	2014-04-24 19:42:01.373285409 +0200
@@ -17,6 +17,11 @@
   unsigned short clower;
 };
 
+#ifdef _WIN32
+#include <windows.h>
+#include <wchar.h>
+#endif
+
 #ifdef OPENOFFICEORG
 #  include <unicode/uchar.h>
 #else
@@ -46,6 +50,21 @@
 static struct unicode_info2 * utf_tbl = NULL;
 static int utf_tbl_count = 0; // utf_tbl can be used by multiple Hunspell instances
 
+FILE * myfopen(const char * path, const char * mode) {
+#ifdef _WIN32
+#define WIN32_LONG_PATH_PREFIX "\\\\?\\"
+    if (strncmp(path, WIN32_LONG_PATH_PREFIX, 4) == 0) {
+        int len = MultiByteToWideChar(CP_UTF8, 0, path, -1, NULL, 0);
+        wchar_t *buff = (wchar_t *) malloc(len * sizeof(wchar_t));
+        MultiByteToWideChar(CP_UTF8, 0, path, -1, buff, len);
+        FILE * f = _wfopen(buff, (strcmp(mode, "r") == 0) ? L"r" : L"rb");
+        free(buff);
+        return f;
+    }
+#endif
+    return fopen(path, mode);
+}
+
 /* only UTF-16 (BMP) implementation */
 char * u16_u8(char * dest, int size, const w_char * src, int srclen) {
     signed char * u8 = (signed char *)dest;
diff -ru hunspell/src/hunspell/csutil.hxx build/hunspell/src/hunspell/csutil.hxx
--- hunspell/src/hunspell/csutil.hxx	2010-09-06 09:58:53.000000000 +0200
{'fraction_non_alphanumeric': 0.16251728907330568, 'fraction_numerical': 0.08367911479944674, 'mean_word_length': 3.5847860538827256, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 4, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3624398', 'n_tokens_mistral': 1335, 'n_tokens_neox': 1192, 'n_words': 253}