07-12-2016 06:37 PM
Hi all,
I have created a .net datagridview control in my labview application using .net container. The user can enter text in the columns and when I read the new value of the cell using the cellvaluechanged event, it all works well. But, when the user enters the text which is not ASCII(korean text in my case), the cellvaluechanged event returns questions marks("?") instead of the unicode text.
I am using win 7 64-bit and LV 2014 64-bit. I have set the language settings on my Windows to korean and in labview.ini I have added the line UseUnicode=True.
Does anyone know how to resolve this issue?
Solved! Go to Solution.
07-12-2016 07:32 PM
@LVCoder wrote:Hi all,
I have created a .net datagridview control in my labview application using .net container. The user can enter text in the columns and when I read the new value of the cell using the cellvaluechanged event, it all works well. But, when the user enters the text which is not ASCII(korean text in my case), the cellvaluechanged event returns questions marks("?") instead of the unicode text.
I am using win 7 64-bit and LV 2014 64-bit. I have set the language settings on my Windows to korean and in labview.ini I have added the line UseUnicode=True.
Does anyone know how to resolve this issue?
There is a reason why Unicode on LabVIEW isn't officially supported. It's a nightmare that can spill over even onto your non-Unicode projects if you are not careful! Be careful when summoning the Unicode demon.
In the meantime, do a Google on "LabVIEW Unicode" and download the toolkit. It makes use of properties not exposed to the user, even with Unicode enabled.
07-12-2016 09:03 PM
I downloaded the unicode tool but I don't understand how to use it because the data returned by the data grid view itself doesn't have any unicode text. The data returned is just question marks. I have attached the sample code here to demonstrate my issue.
Eveytime the data in the data grid view is changed, the string control shows the data returned by DGV.
07-12-2016 10:14 PM
The place where you got the toolkit has very detailed instructions on how to make it work.
07-19-2016 05:23 PM
The following code works for one language as long as you set your Windows System Locale corectly, in your case to Korean.
The string returned from the DGV is DBCS. The ASCII to Unicode function converts DBCS to Unicode using the Windows MultiByteToWideChar function. You can then display the Unicode string on a LV control.
07-19-2016 07:24 PM
Thanks Christian!
Changing the Windows System Locale to Korean solved the issue. 🙂