LaTeX-Box-Team / LaTeX-Box

Lightweight Toolbox for LaTeX - New Official repository
http://www.vim.org/scripts/script.php?script_id=3109
GNU General Public License v3.0
395 stars 66 forks source link

Command :LatexView fails in directories with non-ASCII characters when encoding is set to utf-8 #249

Closed PeturBryde closed 2 months ago

PeturBryde commented 9 years ago

This may be Windows-specific. The commmand :LatexView fails in directories with certain (maybe all) special characters if the Vim setting encoding is set to utf-8. I have characters with accents (e.g. á é í ó) and other special characters in certain directory names. The command :LatexView works for, e.g. D:\My Documents\test\test.tex but not for D:\My Documents\testísl\test.tex or D:\My Documents\test\testísl.tex. Furthermore, compilation with :Latexmk works in the former case where the special character is in the directory name, but not in the latter case where the special character is in the file name (less important because I can refrain from using special characters in the file name, but sometimes the directory name is out of my control).

Looking over the definition of LatexBox_View in common.vim, I think it may have something to do with shellescape(outfile).

function! LatexBox_View(...) let lvargs = join(a:000, ' ') let outfile = LatexBox_GetOutputFile() if !filereadable(outfile) echomsg fnamemodify(outfile, ':.') . ' is not readable' return endif let cmd = g:LatexBox_viewer . ' ' . lvargs . ' ' . shellescape(outfile)