S
Samuel C. Yang
When I want to embed my own XML in a <SolutionXML> element, I need to use a
System.String to assign to the Formula(U) property of an appropriate cell
(named, say, "User.myRow.Value"). There are several problems with this:
(1) I do not see a way to find out the character encoding to use for my XML
string. In looking at generated *.vdx files, I see that the encoding always
seems to be "utf-8". However, I do not see that encoding officially
specified in the Visio documentation, and I do not see a programmatic way to
get that information either. So, there is no way to know the right encoding
to use for my embedded XML.
(2) Even assuming, for the sake of argument, that the encoding is always
supposed to be UTF-8, there is a problem when using the .NET framework (as
in a COM Add-in). In .NET, System.String objects always output UTF-16
strings! How do I output a UTF-8 string in .NET (remember, the object that
assigns to FormulaU must be of type System.String)?
(3) Now, if I cannot even assume that the encoding is always UTF-8 (and
assuming there is a programmatic way to find out the proper encoding to
use), then I have the generalized version of (2). That is, how do I
generate any given encoding under .NET?
System.String to assign to the Formula(U) property of an appropriate cell
(named, say, "User.myRow.Value"). There are several problems with this:
(1) I do not see a way to find out the character encoding to use for my XML
string. In looking at generated *.vdx files, I see that the encoding always
seems to be "utf-8". However, I do not see that encoding officially
specified in the Visio documentation, and I do not see a programmatic way to
get that information either. So, there is no way to know the right encoding
to use for my embedded XML.
(2) Even assuming, for the sake of argument, that the encoding is always
supposed to be UTF-8, there is a problem when using the .NET framework (as
in a COM Add-in). In .NET, System.String objects always output UTF-16
strings! How do I output a UTF-8 string in .NET (remember, the object that
assigns to FormulaU must be of type System.String)?
(3) Now, if I cannot even assume that the encoding is always UTF-8 (and
assuming there is a programmatic way to find out the proper encoding to
use), then I have the generalized version of (2). That is, how do I
generate any given encoding under .NET?