I have a menu item to handle clipboard actions (cut, copy, paste).
When I paste text that I copied from a Hungarian web page, the display
looks normal on my RichTextBox, but the text retrieved from the
clipboard is corrupted. For example, a U with double accent ( byte
code x'FB' ) is replaced by a question mark in my txtEdit.Text after a
Paste operation.
It seems that the Clipboard.GetText() is changing the data.
How is it possible to retrieve the correct byte codes from the
clipboard for Latin 2 (CP 8859-2) ?
Thanks,
xyz
==== My clipboard code for VB5:
Private Sub mnuEditItem_Click(Index As Integer)
Select Case Index
Case 0
' If Index = 0, user chose Cut.
Clipboard.Clear
Clipboard.SetText txtEdit.SelText ' Copy selected
text onto the Clipboard.
txtEdit.SelText = "" ' Clear selected
text from the document.
Case 1
' If Index = 1, user chose Copy.
Clipboard.Clear
Clipboard.SetText txtEdit.SelText ' Copy selected
text onto Clipboard.
Case 2
' If Index = 2, user chose Paste.
txtEdit.SelText = Clipboard.GetText(vbCFText) ' Paste
Clipboard text (if any) into document.
cmdTags.Enabled = True 'Enable "Generate tags" button
End Select
End Sub