发送电子邮件时外来字母失败 [英] Foreign letters failing when sending emails

查看:122
本文介绍了发送电子邮件时外来字母失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有时我必须用德语发送电子邮件,并且需要使用öäß等.我编写了包含这些字母的文本,并使用alert()看起来很不错.我有发送电子邮件的代码:

I sometimes have to send emails in a German and I need to use ö ä ß etc... I have text written containing these letter and using alert() they appear just fine. I have code to send an email :

    var link = "mailto:" + SendTo
         + "&cc= " 
         + "&subject=" + escape(subjectLine)
         + "&body=" + escape(BodyText);
         window.location.href = link;

当我单击一个按钮发送电子邮件时,该文本缺少这些外来字母,例如gruß以gru的形式出现.我需要在这里放些东西以确保这些字母不会消失吗?

When I click a button to send the email, the text is missing these foreign letters e.g gruß comes out as gru. Do I need to put anything in here to make sure these letter don't disappear?

提前谢谢

推荐答案

以下文章显示了如何使用javascript解码字母:

The following articles shows how to decode the letters using javascript :

JavaScript解码html实体

function decodeHtml(html) {
    var txt = document.createElement("textarea");
    txt.innerHTML = html;
    return txt.value;
}

HTML实体解码

使用jquery:

varTitle = $('<textarea />').html("Chris&apos; corner").text();

这篇关于发送电子邮件时外来字母失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆