jimholgate / readtextextension

An Apache OpenOffice & LibreOffice extension to read text with an external program
19 stars 4 forks source link

Encoding problems with tts_wscript.vbs #6

Closed aditsu closed 8 years ago

aditsu commented 9 years ago

I hope this is the right place to report bugs for http://extensions.libreoffice.org/extension-center/read-text (if not, let me know)

I installed this extension on a windows computer and it works fine. But then I installed it on another computer, and it didn't work. The difference is that the 2nd computer has a Chinese version of windows.

This is the error that showed up when I tried to read something: wscript error

I checked the file in question, and found that the problem was caused by the left/right double quotes (in function EscapeReturnsAndReplaceQuotes). The vbs file seems to use the windows-1252 encoding, which doesn't work so well in this Chinese windows. I converted it to utf-8, but it didn't seem to help.

Then I tried to replace those characters with calls to chr. I wrote a tiny MsgBox script for testing the codes, and tried both chr(8220) and chr(147), but neither came up with left double quotes. I used chr(147) and chr(148) anyway in tts_wscript.vbs, and it seems to work now (it ignores the quotes).

Maybe you can find a better solution :)

jimholgate commented 8 years ago

Thank you very much for your write up and contribution.

I have incorporated your modifications in tts_wscript.vbs.