06-22-2010 06:03 AM
It seems that the TdmsChannel unit string, description (and most likely name) properties cannot handle Unicode characters, even though the properties take a .NET System.String parameter. When adding e.g. a description "SPO₂" (SPO2, with a subscript 2) I get the following error:
Cannot marshal: Encountered unmappable character.
This is very inconvenient, as I now have to map from Unicode to something that the TdmsChannel can handle. Whatever that is ... ? (I'm about to start experimenting.)
Solved! Go to Solution.
06-22-2010 06:21 AM
The same problem applies to TdmsProperty (string) values. *sigh*
06-24-2010 01:23 PM
Hello MiF -
Sorry to take so long to get back to you. Unfortunately, I don't have very good news for you either. The TDMS .NET library does not support unicode characters, because the underlying API the .NET layer uses does not support unicode. This should be documented, but for the life of me, I haven't been able to find that documentation. I will file a bug report to improve the documentation of this.
Sorry for any inconvenience,
NickB
National Instruments
06-24-2010 01:52 PM - edited 06-24-2010 01:53 PM
Nick,
1) Can you comment on where exactly the problem is located? TDMS stores all strings as UTF8, and the components used for TDMS access throughout NI software support that accordingly. We might be out of luck in the .NET layer, but maybe there's a chance we can work around this by hooking something into one of the underlying APIs.
2) This should not be documented, this should be fixed. Could you file a CAR for that rather than for a documentation change?
Thanks,
Herbert
06-25-2010 12:35 PM
Update: MStudio calls an interface that was designed to be used within an ANSI C environment. This interface exposes strings as ANSI strings and uses conversion functions further down the chain. Supporting Unicode throughout this part of our component stack is not a small change, so we might end up just documenting this as a known constraint for now.
Thanks,
Herbert
06-26-2010 06:06 AM
Thank you Nick/Herbert for the replies. For now I'm stripping everything that is not plain ASCII. It is not pretty, but at least the app doesn't crash.
Mikael
04-23-2013 12:55 PM
Nick,
I found this thread regarding the same error I have just encountered and wished to see if there is any new information.
So I am running into the same problem with NetworkVariableBufferedWriters (VS 2008). What I am tring to do is serialize an xml object (short document or just a node) and pass it throught the Variable Server to another attached process which presumable deserializes the xml back into an object and acts on the object. Do you have any suggestions on how I might accomplish this task?
I do have Measurement Studio 2013 (and Visual Studio 2012), is this an issue within those version as well?
Thank you very much
Dave Gleason