Create an account to edit articles | See Formatting Syntax for Wiki syntax | We look forward to your contribution!
You are here: The ProductCart Encyclopedia » How To's » Adjust character-set for multilingual store
Adjust character-set for multilingual store
The issue
The default ProductCart character-set is iso-8859-1. This character-set is primarily used for Western European languages (English, French, German, Spanish, etc.) and is a good fit for the majority of ProductCart stores. If your store uses characters found outside of this character-set (e.g. Chinese or Japanese), then you many experience unexpected results. For example, your browser might replace an unsupported character with a diamond or question mark. This article will explain step-by-step how to change ProductCart's character-set so you can use the languages of your choosing.
Solution
ProductCart supports just about any character-set you may choose. There are only a couple lines of code that will need modified.
Header.asp
You can change the character encoding used for the page. Specifically, replace the current “charset” declaration in header.asp by adding the following to the <head> section of the code:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
Often, you will see the following line already in the code (which sets the encoding to Western European):
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
Replace it with:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
… to switch to UTF-8.
If there is no such line in your header.asp file, add it to the <HEAD></HEAD> section of the page. Here is how the revised top section of the header might look:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<!--#include file="include-metatags.asp"-->
<html>
<head>
<%Session.LCID = 1033
if pcv_PageName<>"" then%>
<title><%=pcv_PageName%></title>
<%end if%>
<%GenerateMetaTags()%>
<%Response.Buffer=True%>
<%
Set conlayout=Server.CreateObject("ADODB.Connection")
conlayout.Open scDSN
Set RSlayout = conlayout.Execute("Select * From layout Where layout.ID=2")
Set rsIconObj = conlayout.Execute("Select * From icons WHERE id=1")
%>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
opc_contentType.asp (ProductCart v4+ only)
You also need to change the character encoding used for the One Page Checkout system.
Find:
'//////////////////////////////////////////////////////////////// '// Choose a Character Set '//////////////////////////////////////////////////////////////// ' - ISO-8859-1 ' - UTF-8 '//////////////////////////////////////////////////////////////// pcv_strCharSet = "ISO-8859-1"
Replace it with:
'//////////////////////////////////////////////////////////////// '// Choose a Character Set '//////////////////////////////////////////////////////////////// ' - ISO-8859-1 ' - UTF-8 '//////////////////////////////////////////////////////////////// pcv_strCharSet = "UTF-8"
Trace: • ProductCart v4 - Patch #2 • Installing ProductCart on GoDaddy • Skill Requirements: Using & Customizing Your Store • ProductCart v4.1 - Service Pack 1 • ProductCart v4.0 - Service Pack 4 (One Page Checkout Patch) • Installation: finding and uploading the ProductCart files • ProductCart v3.51 Patch Guide • Moving an existing page to ProductCart's Content Management System • Generating a License for a Downloadable Product • Adjust character-set for multilingual store