Tutorial :French letters on an aspx page



Question:

I have a winForm application that generates an .aspx file based on the user input in the application. The problem happens when a user enters the French letters like "é", "à", "è", "â", "ù", "ô", "ê" and "ç". It is supposed to look like a simple text on the page but it doesn't. Any ideas?


Solution:1

Assuming you want the characters to be displayed with the accents, circumflexes, etc. try the following:

Add the following to the <head> of each (generated) page:

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />  

Make sure that the .aspx files themselves are saved as UTF-8 files.

Note: I'm assuming here that an .aspx file is somewhat similar to a .jsp file. If that assumption is false, you should probably ignore this advice.


Solution:2

How are you creating the .aspx file? If you're using a TextWriter, check the Encoding. If you're trying to write an array of bytes to a FileStream, be sure you use the right encoding when converting from String to Byte[]. UTF-8 is usually the best encoding for the web.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »