Get Chinese data form the clipboard with a parser in C# -


what dataformat should use if have parse data in clipboard contains chinese?

currently i'm using following code parse data datagrid.

object clipboardrawdata = null; parseformat parseformat = null; idataobject dataobj = system.windows.clipboard.getdataobject();  if ((clipboardrawdata = dataobj.getdata(dataformats.commaseparatedvalue)) != null) {      parseformat = parsecsvformat; } else if ((clipboardrawdata = dataobj.getdata(dataformats.text)) != null) {       parseformat = parsetextformat; } string rawdatastr = clipboardrawdata string; 

rawdatastr returns gibberish if clipboard data in chinese

simply use dataformats.unicodetext. dataformats.text try use ansi encoding fail on chinese symbols.


Comments

Popular posts from this blog

javascript - Chart.js (Radar Chart) different scaleLineColor for each scaleLine -

apache - Error with PHP mail(): Multiple or malformed newlines found in additional_header -

java - Android – MapFragment overlay button shadow, just like MyLocation button -