Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Chinese characters cause System.ExecutionEngineException , Clipboard #12149

@light-years-run

Description

@light-years-run

Steps to Reproduce

  1. I run winform application under windows. when I copy chinese characters into Textbox. the Exception occured.
  2. for example chinese characters:测试, Ctrl+C then Ctrl+V into textbox.
  3. stack trace , below:
    System.ExecutionEngineException: String conversion error: Illegal byte sequence
    encounted in the input.
    at (wrapper managed-to-native) System.Runtime.InteropServices.Marshal.PtrToStr
    ingAnsi(intptr)
    at System.Windows.Forms.XplatUIWin32.AnsiToString (System.IntPtr ansi_data) [0
    x00000] in D:\j\workspace\build-package-win-mono\2018-06\mcs\class\System.Window
    s.Forms\System.Windows.Forms\XplatUIWin32.cs:933
    at System.Windows.Forms.XplatUIWin32.ClipboardRetrieve (System.IntPtr handle,
    System.Int32 type, System.Windows.Forms.XplatUI+ClipboardToObject converter) [0x
    0008d] in D:\j\workspace\build-package-win-mono\2018-06\mcs\class\System.Windows
    .Forms\System.Windows.Forms\XplatUIWin32.cs:2893
    at System.Windows.Forms.XplatUI.ClipboardRetrieve (System.IntPtr handle, Syste
    m.Int32 type, System.Windows.Forms.XplatUI+ClipboardToObject converter) [0x00000
    ] in D:\j\workspace\build-package-win-mono\2018-06\mcs\class\System.Windows.Form
    s\System.Windows.Forms\XplatUI.cs:575
    at System.Windows.Forms.Clipboard.GetDataObject (System.Boolean primary_select
    ion) [0x00039] in D:\j\workspace\build-package-win-mono\2018-06\mcs\class\System
    .Windows.Forms\System.Windows.Forms\Clipboard.cs:390
    at System.Windows.Forms.Clipboard.GetDataObject () [0x00000] in D:\j\workspace
    \build-package-win-mono\2018-06\mcs\class\System.Windows.Forms\System.Windows.Fo
    rms\Clipboard.cs:137
    at System.Windows.Forms.TextBoxBase.ProcessKey (System.Windows.Forms.Keys keyD
    ata) [0x000a4] in D:\j\workspace\build-package-win-mono\2018-06\mcs\class\System
    .Windows.Forms\System.Windows.Forms\TextBoxBase.cs:1101
    at System.Windows.Forms.TextBoxBase.WndProc (System.Windows.Forms.Message& m)
    [0x0003e] in D:\j\workspace\build-package-win-mono\2018-06\mcs\class\System.Wind
    ows.Forms\System.Windows.Forms\TextBoxBase.cs:1495
    at System.Windows.Forms.RichTextBox.WndProc (System.Windows.Forms.Message& m)
    [0x00000] in D:\j\workspace\build-package-win-mono\2018-06\mcs\class\System.Wind
    ows.Forms\System.Windows.Forms\RichTextBox.cs:1191
    at System.Windows.Forms.Control+ControlWindowTarget.OnMessage (System.Windows.
    Forms.Message& m) [0x00000] in D:\j\workspace\build-package-win-mono\2018-06\mcs
    \class\System.Windows.Forms\System.Windows.Forms\Control.cs:228
    at System.Windows.Forms.Control+ControlNativeWindow.WndProc (System.Windows.Fo
    rms.Message& m) [0x00000] in D:\j\workspace\build-package-win-mono\2018-06\mcs\c
    lass\System.Windows.Forms\System.Windows.Forms\Control.cs:209
    at System.Windows.Forms.NativeWindow.WndProc (System.IntPtr hWnd, System.Windo
    ws.Forms.Msg msg, System.IntPtr wParam, System.IntPtr lParam) [0x00085] in D:\j
    workspace\build-package-win-mono\2018-06\mcs\class\System.Windows.Forms\System.W
    indows.Forms\NativeWindow.cs:240

Current Behavior

Expected Behavior

On which platforms did you notice this

[ ] macOS
[ ] Linux
[ ] Windows

Version Used:

Stacktrace

Please paste the stack trace here if available.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions