Jump to content
Sign in to follow this  

Is There A Bug In Compare Of Ascii ?

Recommended Posts



my code is


unsigned char c=0xe8;


else if(c=='é')

lcd_write(4); //in LCD CGRAM 4 position



else if(c=='é') _LCD_Write( 4 ); //francais e

2382 D7B9 BRA label268439317

2384 0EE9 MOVLW 0xE9

2386 63B3 CPFSEQ LCD_Printf_00000_1_c, 1

2388 D007 BRA label268439385

238A BFB3 BTFSC LCD_Printf_00000_1_c,7, 1 ///**sign check

238C D005 BRA label268439385

238E 0E04 MOVLW 0x04

2390 6FCA MOVWF LCD_Write_00000_arg_d, 1

2392 ECA8F00E CALL LCD_Write_00000

2398 label268439385



I was found solution

else if(c==0xe8)



Oktay CIT

Share this post

Link to post
Share on other sites
else if(c=='é')



else if(c=="é") or else if(c==(unsigned char)'é')

Should work.

When you used 'é', you were specifying it as an integer datatype, where

as "é" is a string/char datatype.

Share this post

Link to post
Share on other sites

Thank you?


Why is it? the "e" is a string isn't it ? (0xe8 +NULL)

'e' must be unsigned char but It is signed char.




According to my ANSI C99 Reference using 'x' denotes it as an integer

where "x" is a char and "xyz" is a char array with an automatic addition

of \n to terminate the sequence.

Share this post

Link to post
Share on other sites

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Create New...