Solved

character encoding french text

Posted on 2008-10-24
5
864 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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
updateParent() HTML Javascript 21 61
Detecting robots? 5 35
WEB Farm 6 26
Fixed div within Bootstrap carousel item 11 30
I've been asked to discuss some of the UX activities that I'm using with my team. Here I will share some details about how we approach UX projects.
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
The viewer will learn how to count occurrences of each item in an array.
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

746 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now