Help with wide strings
Well, I feel kind of stupid asking this but I am having some trouble settings text programmatically on my Buttons and TextBlock objects. All my text uses 16 bit characters (it is Japanese). I'm a little lost looking through the string headers. I'm also a little confused because some of the documentation (namely Core.Kernel.Strings.html) references code that appears to be missing from the include directory of the SDK (I don't see String16).
How can I construct an NsString with 16 bit characters to give to SetText of a TextBlock?
How can I provide a 16 bit character string to a Button which does not have a SetText method, but a SetContent method instead?
I can do these things fine through the xaml, but I need to be able to do it in code as well.
How can I construct an NsString with 16 bit characters to give to SetText of a TextBlock?
How can I provide a 16 bit character string to a Button which does not have a SetText method, but a SetContent method instead?
I can do these things fine through the xaml, but I need to be able to do it in code as well.
Re: Help with wide strings
NoesisGUI is now UTF8 compliant in everything. This means that we use char (8 bits) for everything. It is decoded properly when needed. It is very important that XAML are saved used UTF8 convention.Well, I feel kind of stupid asking this but I am having some trouble settings text programmatically on my Buttons and TextBlock objects. All my text uses 16 bit characters (it is Japanese). I'm a little lost looking through the string headers. I'm also a little confused because some of the documentation (namely Core.Kernel.Strings.html) references code that appears to be missing from the include directory of the SDK (I don't see String16).
For runtime, unicode strings from c# are marshaled to utf8 so I think that everything should work without doing anything special. Could you paste me a code in c# that is not working?
As said, normal strings in c# should work. If you have problems, there is a bug.How can I construct an NsString with 16 bit characters to give to SetText of a TextBlock?
There is no SetText in the button because a button can contain anything. For your purpose you must use the SetContent(string) function. There is a version that accepts string as parameter.How can I provide a 16 bit character string to a Button which does not have a SetText method, but a SetContent method instead?
I can do these things fine through the xaml, but I need to be able to do it in code as well.
Re: Help with wide strings
Thank you for the clarification. I didn't realize it was expecting UTF8, but upon converting my existing strings to this format they can be displayed with no problem. 

Who is online
Users browsing this forum: Ahrefs [Bot] and 4 guests