tags:

views:

52

answers:

2

Hi ,

There is an encoding issue in the web page means it showing some special characters in the browser(Cinéma). content is in ISO, web page is rendering in UTF-8. some articles are displaying properly,bcz those are in UTF encode.some of the articles are shows the encoding issue like Cinéma in Perl 5.

Can any once help me out for this encoding issue.that would be a great!

Thanks in advance.

+1  A: 

Ensure your Content-type header, or meta document element, contains correct encoding information.

A quick and easy way to test if this is your issue is to ask the browser to render the page as if it had received a specific encoding directive. In Safari this would be View -> Text Encoding and then selecting something appropriate.

I'd hazard a guess that if you inform the browser to use utf-8 then it will render the page correctly.

ptomli
Yes what you said every thing is correct.
panidarapu
but here in my case i check apache httpd.doc file for server side encoding it is in UTF only,Meta tag is also in UTF
panidarapu
When you make the request to the server, what Content-type does the server actually send. Again, Safari/Chrome developer tools let you inspect the headers returned by the server. It's all well and good to say the Apache config is OK, but clearly something is not working, so check what's actually being returned.
ptomli
A: 

The only way to solve this will be to spend some time reading up on Unicode and UTF-8 and how to handle encoding in Perl. (perldoc perluniintro, perldoc perlunitut, perldoc perlunicode, perldoc perlunifaq for example).

UTF-8 encoding is a very different concept to other encodings that programmers encounter (escaping in strings, URL encoding, HTML character entities, etc) - it's about how your code should interpret sequences of bytes as characters.

Without knowing the source of the word containing the special character (an accented 'e'), it's impossible to offer further help - is it coming from a database? in a static HMTL page? in an HTML template? a string within Perl code?

plusplus