Showing results for 
Search instead for 
Do you mean 
Reply
Solved! Go to solution

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

 

3 REPLIES
Solution
Solution
Accepted by topic author AhmedAllam
‎02-19-2016 04:31 AM

Re: Encoding problem with Tabnot

 

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

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

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


Re: Encoding problem with Tabnot

many thanks for your help guys

 

this line solved the problem

theUfSession.Text.SetTextMode(UFText.ModeS.AllUtf8);