Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OS-specific char encodings

Status
Not open for further replies.

seancarter

IS-IT--Management
Sep 3, 2002
2
GB
Anyone know of a standard library/header file dealing with OS-specific encodings of special language-specific characters? esp. umlauted characters in German, and their ASCII values.
I need to parse a string, recognise German characters and convert them into their anglicised form.
e.g
convert 'Müller'
into
'Mueller'
etc.

Thanks
Sean
 
hi ..

ü is not part of the ascii / extended ascii table -> as far as i know. may be the approach to solve your problem should be by some other means.

br:
 
hi,

if you write a program loading a buffer from
keyboard

int i ;
char buf[16]
getchar( buffer );
for( i=0 ; i<strlen(buffer) ; i++ )
printf( &quot;%02d %02d %c\n&quot;, i, buffer, buffer ) ;



what do you see on output ?


BYE
 
I got this [I added commas for clarity]:

a.out
FäöüÄÖÜßL [my input]
00, 70, F
01, -28, ä
02, -10, ö
03, -4, ü
04, -60, Ä
05, -42, Ö
06, -36, Ü
07, -33, ß
08, 76, L
 
hi,

sorry, but is better if

printf( &quot;%02d %02u %c\n&quot;, i, buffer, buffer ) ;

to be more clear.

(Instead of 04, -60, Ä yu'll see 04, 175, Ä )

However create a routine that

unsigned char c ;

switc( c )
{
case 175: c='A' ; break
case 168: c='O' ; break
}


bye
 
hmm .. that is a brilliant idea.
but, will the code be portable ?

br:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top