pspad:
--------------------------------------------------------------------------------
When you open file, all is encoded into UTF-16. Change of it isn't
possible, at least without rewriting near whole program.
--------------------------------------------------------------------------------

UTF-16 supports surrogate pairs for characters higher than U+FFFF. Windows XP
can handle these two-widechar combinations, it works fine!

For example:

const
  Smile: array[0..2] of WideChar = (WideChar($D83D), WideChar($DE0A), #0);
begin
  MessageBoxW(Application.Handle, @Smile, nil, 0);
end;

This code will show only one "rectangular character" because surrogate pair
contains only one UTF-16 character.

Unfortunately, MultiByteToWideChar function cannot decode 4-byte UTF-8 under
Windows XP, this was my mistake. I will investigate more. My program uses own
UTF-8 decoder, written from scratch, but a little complex for use outside of
library it contains.

I can write new Utf8Decode/Utf8Encode functions for PSPad, if you ready to use
them. :-))

-- 
<http://forum.pspad.com/read.php?4,45099,64626>
PSPad freeware editor http://www.pspad.com

Odpovedet emailem