Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

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.

Latest threads

New Articles From Microcontroller Tips

Back
Top