in qnx,how to convert unicode to ANSI character(8 bits)?

I need convert unicode to ANSI charater and ANSI charater to unicode in qnx,Who knows how to do using c?

I am not sure about this now, but if unicode is the same as wide char you can have a look at the wchar functions (like wctob()):

indeed,I need to show some chinese character in phab in GB2312,default the code is UTF-8

I have used Px function,but I found that memory is to 100% after using it.

Then you are doing something wrong ;-)

oh,I do it exactly same compare to the sample in help.

my code is below:
void GetCode2312(char code[16],char utf[100])
struct PxTransCtrl *trans;
trans = PxTranslateSet(NULL, “GB2312”);

PxTranslateStateToUTF(trans, code,
                      strlen(code), NULL, utf,

code is the character with encoding GB2312,I use the function to change it to unicode utf,when I use the function,the memory increases continually,why?

I’ll give you that one, the doc isn’t clear on this (Steve are you reading this). If you read the doc to TxTranslateSet it says that it allocated resources. Allocates it the keywork here. You should only call PxTranslateSet once.

mario,you say I should use PxTranslateSet once,but if the user can select the encoding in one list,how can I release the resource and use it again?I mean that sometimes I need to use PxTranslateSet several time in my programme,Do I need to release the resources allocated by PxTranslateSet ?the system has done it automatically for me,Is it right?

I looked for that when I check the doc and I couldn’t find any info about that.

I would write a test program that does PxTranslateSet in a loop do see if that is really what consumes the memory.

Sorry can’t be of more help, not a photon expert.

mario,I 'm waiting for your result,:).

It was a suggestion of what I would do, how I would chase the problem. But I never planed to this testing myself -)

I did see this, but then lost the thread…

Is the problem that the docs don’t tell you which resources to free? (I haven’t worked on the Photon docs for a while, so I’m a little rusty on them.)

Yes the problem is that nothing is warning you that calling TxTranslateSet will consume resources that you will never be able to free (that is still to be confirmed)