CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

I need String replace for print Turkish characters

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
pcmgogo



Joined: 25 Dec 2004
Posts: 9

View user's profile Send private message

I need String replace for print Turkish characters
PostPosted: Sun Nov 09, 2008 4:12 pm     Reply with quote

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

View user's profile Send private message

Re: I need String replace for print Turkish characters
PostPosted: Sun Nov 09, 2008 7:51 pm     Reply with quote

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;
   }

   putc(c)
}
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group