Showing results for 
Search instead for 
Did you mean: 

Encoding problem with Tabnot


Hello all,


I am dealing with a program which exports data from a windows form to a tabular note, the program works fine for nx8.5 but for nx10 the program throws an exception for this line of code


theUfSession.Tabnot.SetCellText(cell, entry[i]);


whenever entry[i] contains a degree sign " ° " , and the exception has someting to do with UTF-8 encoding.


i have tried other types of encoding and at best i got '?' instead of  '°' 


any help would be appreciated



Re: Encoding problem with Tabnot

Siemens Phenom Siemens Phenom
Siemens Phenom


Try adding a call to the UfSession.Text.SetTextMode(2); at the beginning of your program.


(If it doesn't like the "2", you'll have to find the text-mode enum for AllUtf8.)


For details, see the NX Open C Reference Guide and find UF_TEXT_set_text_mode.

Re: Encoding problem with Tabnot

Esteemed Contributor
Esteemed Contributor

Or instead of figuring out all the UTF-8 stuff, just try using the following string "<$s>" (without the quotes) for the degree symbol.


If you search the docs for "text control characters" you will find all sorts of symbols can be made this way.



Ken Akerboom Sr CAx Systems Engr, Moog, Inc.
Production: NX10.0.3.5 MP16/TC11.2
I'd rather be e-steamed than e-diseaseled

Re: Encoding problem with Tabnot


many thanks for your help guys


this line solved the problem