[Vm-dev] Unicode clipboard in Windows

Andreas Raab andreas.raab at gmx.de
Tue May 29 16:19:14 UTC 2007

Chris Petsos wrote:
> Ok i am trying to brake down the clipboard-responsible code so that i 
> can add unicode clipboard support.. the news are not so good.
> First, i saw that the code for sending text to the clipboard is
>     int clipboardWriteFromAt(int count, int byteArrayIndex, int startIndex)
> in
>     sqWin32Window.c
> The thing is that we are trying to create a fully Unicode VM...this 
> means that the characters that are sent to the VM are Unicode (> 
> 256) and we are using a unicode TT font to render them.
> Now... when i evaluate this
> c:=Clipboard new.
> c primitiveClipboardText:'α'    "α is unicode char 945"
> the clipboardWriteFromAt is never invoked.

Indeed. I would recommended using UTF-8 instead. It is well supported on 
Windows (a one-liner to convert to TCHAR) and takes a huge amount of 
pain out of the conversions.

   - Andreas

More information about the Vm-dev mailing list