I need String replace for print Turkish characters
Posted: Sun Nov 09, 2008 4:12 pm
I am controlling a thermal printer with RS232 via Pic16F877.
I am using printf function for sending characters to the printer. My printer and Pic uses different charset for sending and receiving characters. For example If I want to print 'ç' character I have to send 0x87 to the printer.
I solved this problem on Pc with string replace function. My windows based test program checks string for Turkish character and replace them to new value then printer prints them correctly.
How could I check string and replace some characters for Turkish language on CCS.
MarcosAmbrose
Joined: 25 Sep 2006 Posts: 38 Location: Adelaide, Australia
Re: I need String replace for print Turkish characters
Posted: Sun Nov 09, 2008 7:51 pm
pcmgogo wrote:
How could I check string and replace some characters for Turkish language on CCS.
Use printf as you normally would, but pump the characters through a function that checks each character one at a time.
The code below will only check for one character, but you'll get the general idea.
Code:
printf(Turkish_Putc,"A String with Turkish çhars\n\r");
void Turkish_Putc(char c)
{
if(c=='ç')
{
c=0x87;
}
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum