YeO:
--------------------------------------------------------------------------------
I have written a Javascript extension to do some cleanup of a text file.
However, it does not preserve UTF-8 character and returns '?' where such
characters were found. How can I preserve the original character ?
--------------------------------------------------------------------------------


Hi,
it seems, that you hit a limitation of the current interface of the scripting
support in PSPad (it may be enhanced in the planned version of the program).
If I understand correctly, only ANSI characters can be passed between the script
code and the GUI of the editor.

In my older script
http://www.vbr.wz.cz/pspad/poor-man-s-REplace.html
I used a hackish workaround - the text inserted from the script is newly read
from the editor, and if a mismach is found, a supplementary version of the
output is generated in a new tab - as html code with non ascii characters coded
as unicode number entities.
The text can than be copied from the html preview.
(the code is in the function checkAndSupplResult in the script; be sure to check
it works as intended for your needs, if you reuse it).
hth,
  vbr

-- 
<http://forum.pspad.com/read.php?2,66423,66424>
PSPad freeware editor http://www.pspad.com

Odpovedet emailem