Unicode on PIC programming.

Status
Not open for further replies.

liupengjian

New Member
Hi, everyone.
I am doing a project on 18F452 using C, we need to code Chinese and English characters by unicode. Previously we use only 8bits data,now we need to change to 16bit unicode. I really dont know how to do it, so any suggestions to do so in an easy way?

Is it something like put a Null character on evey English char?
ie. How to change: char a[]="Hello,world"; to Unicode form?

Thanks.
 
liupengjian said:
Is it something like put a Null character on evey English char?
ie. How to change: char a[]="Hello,world"; to Unicode form?
Thanks.

Maybe this will work:
char a[]="\0H\0e\0l\0l....\0l\0d\0"; // An extra zero at the end for unicode string terminator (the compiler should add the other zero I presume)

But I can't guarantee that this will work.

BR
 
Perhaps, you need to get a PIC C compiler that supports unicode encoding. I don't know if one exists, however. :?
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…