C
Colin Peters
Hi,
I'm reading a file and writing it to the html output for a page.
I've come across two difficulties which I would like to solve.
The files contain special characters from European alphabets, namely
those which have the two little dots above the vowels called umlauts.
Normally, these are rendered in html using "%auml;", but in the file
they are just ä.
1. I'm using a StreamReader to read the file and I have found that if I
don't use System.Text.Encoding.UTF7 then the characters are lost
completely. Is this the correct way, or is there a way to automatically
get the Stream Reader to select the correct encoding, or use other code
to determine which would be best?
2. Having read the character from the file, it is output literally to
the html, which I guess is to be expected. Is there a way to process a
string in order to change the ä to &äuml; and so on.
Thanks in advance for any replies.
I'm reading a file and writing it to the html output for a page.
I've come across two difficulties which I would like to solve.
The files contain special characters from European alphabets, namely
those which have the two little dots above the vowels called umlauts.
Normally, these are rendered in html using "%auml;", but in the file
they are just ä.
1. I'm using a StreamReader to read the file and I have found that if I
don't use System.Text.Encoding.UTF7 then the characters are lost
completely. Is this the correct way, or is there a way to automatically
get the Stream Reader to select the correct encoding, or use other code
to determine which would be best?
2. Having read the character from the file, it is output literally to
the html, which I guess is to be expected. Is there a way to process a
string in order to change the ä to &äuml; and so on.
Thanks in advance for any replies.