Solved

character encoding french text

Posted on 2008-10-24
5
869 Views
Last Modified: 2013-12-09
I have a website with french characters in the content, an asp website.  It currently doesn't have Content-Type metatag set, and is comming back with square blocks in google for characters like e-accent, and also in some browsers.  I would like to know what I should set the Content-Type to (iso-8859-1 or utf8?), and if I should do anything in the asp code also (can I get response.write to output in a particular character-set)
0
Comment
Question by:harrylockhart
  • 2
  • 2
5 Comments
 
LVL 6

Expert Comment

by:Werrock
ID: 22794405
Is unicode perhaps applicable?
http://en.wikipedia.org/wiki/Unicode_and_HTML
0
 

Author Comment

by:harrylockhart
ID: 22795635
I've read the document, and would like to verify the below before putting anything online
I understand that character-set dependant on the format that is was saved in?
the content is created in InnovaEditor, and is stored in a sqlserver2000 table, the pages are created in asp classic.  Some of the content is also held in html file includes.
What I want to know is
1) if I set the content-type in the meta-tags to utf-8, will this just resolve the issue
2) Do I need to ensure that the page is outputted in a particular character-set?  if so, I need to be able to set the character set used for output generated by response.write, how can I do this?  Would the best output foramt be utf-8?
3) (if relevant) How do I find what format the data is generated in?? or stored in??
0
 
LVL 44

Expert Comment

by:scrathcyboy
ID: 22799968
If you don't have UTF-8 in all documents that made the code to begin with, stored it into the database, retrieved it, and displays it, you will encounter loss of higher order ascii codes.  So all steps need to be enabled to use higher-order ascii characters for this to work, including the database.
0
 

Author Comment

by:harrylockhart
ID: 22802637
Reading this link yesterday
http://www.example-code.com/asp/asp-codepages.asp,
I will need to set the session.codepage to 65001 and then response.write will output in utf8 format for the rest of the session.  This will deal with all the db data I think.  I think it won't deal with the include files (am I worng?)
The asp application holds includes as follows, for all pages.
<!-- BEGIN HEADER -->
<!-- #include file="Menu_Header.asp"-->
<!-- END HEADER -->
If I set <% @CodePage = 65001 %> in the header file, will this set the codepage for all include files also?  Do I need to save all these files with speacial encoding?  If so it would be easier to find the current encoding of the files, and set the session.codepage to this.  However, the files are saved without any special encoding set, so I am not sure what encoding they are saved in.  Do you know how I can find this out?
0
 
LVL 44

Accepted Solution

by:
scrathcyboy earned 500 total points
ID: 22804513
"will this set the codepage for all include files also?"

generally, no.  If they are code fragments yes, but if they are html pages with a head, you should either change the codepage in the head of those, or just make the file a BODY or code fragment.  It depends on how they are included as to whether they need to be a full HTML file with header,or not.  Check them.

"However, the files are saved without any special encoding set, so I am not sure what encoding they are saved in."

If they have a head section, the encoding will default to charset=iso-8859-1 -- so if you want to be certain, change it to UTF-8

0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Developer portfolios can be a bit of an enigma—how do you present yourself to employers without burying them in lines of code?  A modern portfolio is more than just work samples, it’s also a statement of how you work.
FAQ pages provide a simple way for you to supply and for customers to find answers to the most common questions about your company. Here are six reasons why your company website should have a FAQ page
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.

713 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question