@@ -110,6 +110,16 @@ function(files, filter, control = list(), encoding = "unknown",
110110            aspell_write_personal_dictionary_file(words , personal ,
111111                                                  program  =  program )
112112            # # </FIXME>
113+ 
114+             # # For aspell (only!) on Windows, we need the special Unix path form 
115+             # # such as /c/path/to/dictionary
116+             # # known from, e.g., msys2 to specify the personal dictionary:
117+             if (grepl(" aspell" program )){
118+                 personal  <-  normalizePath(personal , winslash = " /" 
119+                 if (grepl(" ^.:" personal )) 
120+                     personal  <-  gsub(" ^(.):(.*)$" " /\\ 1\\ 2" personal )
121+             }
122+ 
113123            control  <-  c(control , " -p" personal ))
114124        }
115125    }
@@ -1412,7 +1422,11 @@ function(x, out, language = "en", program = NULL)
14121422        header  <-  NULL 
14131423    }
14141424
1415-     writeLines(c(header , x ), out , useBytes  =  TRUE )
1425+     # # we need Unix line endings even on Windows 
1426+     # # (at least for aspell, and works for hunspell, too):
1427+     outfile  <-  file(out , open  =  " wb" 
1428+     on.exit(close(outfile ))
1429+     writeLines(c(header , x ), outfile , useBytes  =  TRUE )
14161430}
14171431
14181432# # For reading package defaults:
0 commit comments