Ron89 / thesaurus_query.vim

Multi-language Thesaurus Query and Replacement plugin for Vim/NeoVim
http://www.vim.org/scripts/script.php?script_id=5341
Apache License 2.0
220 stars 23 forks source link

cilin_txt backend cannot work #41

Closed VimWei closed 5 years ago

VimWei commented 5 years ago

I downloaded "cilin.txt" from shijiebei2009/Algorithms , and make sure that cilin.txt is utf-8 encoded. But the plugin still do not function correctly with the file.

GIF Demo

cilin error

My .vimrc setting:

let g:tq_openoffice_en_file=$HOME . "/.vim/thesaurus/MyThes-1.0/th_en_US_new"
let g:tq_mthesaur_file=$HOME . "/.vim/thesaurus/mthesaur.txt"
let g:tq_cilin_txt_file=$HOME . "/.vim/thesaurus/cilin.txt"
let g:tq_enabled_backends=["thesaurus_com","openoffice_en","mthesaur_txt","datamuse_com","cilin_txt"]
let g:tq_language=['en', 'cn']

Other backends is working well.

VimWei commented 5 years ago

chinese

VimWei commented 5 years ago

error spell

Ron89 commented 5 years ago

Hi, @ChenWeird , I think both comments refers to a same issue. Cilin text file has some encoding issue. The reason error spell lead to error is that thesaurus.com query didn't manage to find any positive hit. So cilin_txt is activated. I did some searching on stackover flow, it is possible that your file is encoded in ISO-8869-1 instead of UTF-8. Code you try properly decoding it before encoding it again? https://stackoverflow.com/questions/25599816/unicodedecodeerror-utf8-codec-cant-decode-byte-0xba-in-position-1266-invali

I am not familiar with Windows, but this link might help in re-encoding the file https://superuser.com/questions/1163753/converting-text-file-to-utf-8-on-windows-command-prompt

Ron89 commented 5 years ago

@ChenWeird , any updates on this issue?

Ron89 commented 5 years ago

Closing now due to lack of confirmation on the issue.