[opencms-dev] Character set in OpenCMS 5.0.1
Phan Dang Dinh
phan_dang_dinh at yahoo.co.uk
Thu Aug 19 03:56:55 CEST 2004
Hi,
First, you must set -Dfile.encoding=UTF-8 for Tomcat
Second, open file opencms.properties and change
defaultContentEncoding=ISO-8859-1 to
defaultContentEncoding=UTF-8
Next, pls test this code:
<%@ page pageEncoding="UTF-8" %>
<%@ page
import="java.util.*,com.opencms.flex.jsp.*,com.opencms.file.CmsObject,com.opencms.file.*,
com.opencms.core.CmsException" %>
<%@ page language="java" contentType="text/html;
charset=utf-8" pageEncoding="UTF-8"%>
<%@ page session="false" %>
<%
request.setCharacterEncoding("utf-8");
CmsJspActionElement cms = new
CmsJspActionElement(pageContext, request, response);
cms.getRequestContext().setEncoding("UTF-8");
String s = request.getParameter("testparam");
out.println(s);
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=utf-8" />
<title></title>
</head>
<body>
<form method="post" action"."
accept-charset="UTF-8">
<input type="text" name="testparam">
<input type="submit" value="Submit">
<input type="reset" value="Reset">
</form>
</html>
Dinh
--- "Zafra Jimenez, Ignacio"
<ignacio_zafra at merck.com> wrote:
> We want to use Unicode characters in OpenCMS (
> Apache Tomcat/5.0.19 /Red Hat
> Linux 9).
> HTTP header must contain: "Content-Type: text/html;
> charset=UTF-8", instead
> of current configuration: "Content-Type:
> text/html;charset=ISO-8859-1", in
> order to acept querystring in UTF-8 from another
> website.
> What I need to configure? Apache, Tomcat, OpenCMS?
> Thanks.
> Regards, Ignacio Zafra
>
>
>
>
------------------------------------------------------------------------------
> Notice: This e-mail message, together with any
> attachments, contains information of Merck & Co.,
> Inc. (One Merck Drive, Whitehouse Station, New
> Jersey, USA 08889), and/or its affiliates (which may
> be known outside the United States as Merck Frosst,
> Merck Sharp & Dohme or MSD and in Japan, as Banyu)
> that may be confidential, proprietary copyrighted
> and/or legally privileged. It is intended solely for
> the use of the individual or entity named on this
> message. If you are not the intended recipient, and
> have received this message in error, please notify
> us immediately by reply e-mail and then delete it
> from your system.
>
------------------------------------------------------------------------------
>
>
> _______________________________________________
> This mail is send to you from the opencms-dev
> mailing list
> To change your list options, or to unsubscribe from
> the list, please visit
> http://mail.opencms.org/mailman/listinfo/opencms-dev
>
___________________________________________________________ALL-NEW Yahoo! Messenger - all new features - even more fun! http://uk.messenger.yahoo.com
More information about the opencms-dev
mailing list