Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/email/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Email 电子邮件格式的字符编码问题_Email_Forms_Jsp_Character Encoding - Fatal编程技术网

Email 电子邮件格式的字符编码问题

Email 电子邮件格式的字符编码问题,email,forms,jsp,character-encoding,Email,Forms,Jsp,Character Encoding,我有一个简单的jsp表单,客户使用它向我们发送电子邮件。尽管在某些情况下,电子邮件的格式不正确,文本=?ISO-8859-1?Q?偶尔显示在整个电子邮件文本中 我知道ISO-8859-1是一种字符编码,但我不确定该错误是如何发生的,并且无法重现该错误。我尝试用Firefox选择的不同字符编码填写表单,但仍然无法复制。我曾尝试使用带有中文Win XP语言设置的笔记本电脑填写表格,但也无法重现此错误 有没有人看到这个错误,或者有没有人知道我如何重现这个错误 感谢您的评论-我仍在寻找复制此错误的方法或

我有一个简单的jsp表单,客户使用它向我们发送电子邮件。尽管在某些情况下,电子邮件的格式不正确,文本
=?ISO-8859-1?Q?
偶尔显示在整个电子邮件文本中

我知道ISO-8859-1是一种字符编码,但我不确定该错误是如何发生的,并且无法重现该错误。我尝试用Firefox选择的不同字符编码填写表单,但仍然无法复制。我曾尝试使用带有中文Win XP语言设置的笔记本电脑填写表格,但也无法重现此错误

有没有人看到这个错误,或者有没有人知道我如何重现这个错误

感谢您的评论-我仍在寻找复制此错误的方法或其发生的原因

jsp代码在WebLogic9中的portlet中使用非常简单(如下所示)

<%@ page language="java" contentType="text/html;charset=UTF-8"%>
<%@ taglib uri="/WEB-INF/struts-adapter-html.tld" prefix="html"%>
<%@ page  import="java.lang.String" %>
<html:html>
<html:head>
    <title>Feedback Form</title>
</html:head>
<html:body> 
    <html:form action="/emailFeedback">
            <label>First name </label>
            <html:text property="forename"/>
            <label>Surname </label>
            <html:text property="surname"/>
            <label>telephone number </label>
            <html:text property="telephonenumber"/>
            <label>Zip code</label>
            <html:text property="zipcode"/>
            <label>DOB (MM/DD/YYYY)</label>
            <html:text property="dob" />
            <label>Email </label>
            <html:text property="email"/>
            <label>Confirm Email </label>
            <html:text property="confirm_email"/>
            <label>Subject</label>
            <html:selectproperty="category">
                <html:option value="">select &gt; &gt;</html:option>
                <html:option value="Test1">Test1</html:option>
                <html:option value="Test2">Test2 Payments</html:option> 
                <html:option value="Test3">Test3</html:option>
            </html:select>
            <html:textarea property="feedback" cols="40" rows="7" />
            <input value="Submit your query" type="submit">
        </html:form>
</html:body>
</html:html>
以下是格式正确的电子邮件示例,以供参考:

 firstnameame:  John    
 last ame:      Doe
 email:     john.doe@test.com
 DOB:       01/02/1957
 Telephone :    005465465465
 ZIPCODE:       91210
 Feedback:     
 Correctly formatted feedback.

ISO-8859-1
编码仅涵盖标准拉丁字符,不包括中文。要覆盖中文以及世界上任何其他可用字符,最好使用
UTF-8

有关更多技术背景信息以及如何相应地配置JSP/Servlet环境以使用
UTF-8
的几种解决方案,请参见


希望这会有所帮助。

=?ISO-8859-1?Q?text?=
是一种语法,用于指示文本(在最后两个文本之间)以ISO-8859-1编码,在通常只允许ASCII的上下文中可打印

此语法通常用于仅允许ASCII格式的电子邮件标题


如果看不到电子邮件和生成电子邮件的代码,就很难说问题出在哪里。

谢谢BalusC。非常好的帖子完美地描述了我的问题!我试图在表单中输入字符串Český,结果收到了同样格式错误的电子邮件。正如您的博客所说的解决方案可以在JSP或Web服务器级别实现,以强制实施UTF-8编码。:)不客气。别忘了将问题标记为已回答:)如果可以,我也会投赞成票,在我获得此个人资料的代表后再投:)
 firstnameame:  John    
 last ame:      Doe
 email:     john.doe@test.com
 DOB:       01/02/1957
 Telephone :    005465465465
 ZIPCODE:       91210
 Feedback:     
 Correctly formatted feedback.