CKEditor 使用 ASP.NET 发送电子邮件 [vb] - 特殊字符问题

发布于 2024-09-18 18:52:39 字数 464 浏览 3 评论 0原文

我有一个标准的 HTML 页面,上面有一个 CKEditor,包裹在一个表单中。 表单提交(POSTS)到Send_Emails.aspx

Send_Emails.aspx 将FCKEditor 的内容读取到变量中

Dim html As String = Request.Form("ck_content")

然后发送一封电子邮件。

问题

字符,例如:

 -> this seems to show as a special character for blank spaces/carriage returns
’ -> this seems to show as apostrophe's

您能推荐一些方法来清理我的帖子数据中的这些非标准字符吗?

谢谢

I have a standard HTML page with an CKEditor on it wrapped in a form.
The form submits (POSTS) to Send_Emails.aspx

Send_Emails.aspx reads the content of the FCKEditor into a variable

Dim html As String = Request.Form("ck_content")

Then it sends an email.

Problem

Characters such as:

 -> this seems to show as a special character for blank spaces/carriage returns
’ -> this seems to show as apostrophe's

Can you reccomend some methods to cleanze my post data of these non-standard characters?

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

染柒℉ 2024-09-25 18:52:39

我想出了如何使用此函数删除不需要的字符:

function removeMSWordChars(str) {
    var myReplacements = new Array();
    var myCode, intReplacement;
    myReplacements[8216] = 39;
    myReplacements[8217] = 39;
    myReplacements[8220] = 34;
    myReplacements[8221] = 34;
    myReplacements[8212] = 45;
    for(c=0; c<str.length; c++) {
        var myCode = str.charCodeAt(c);
        if(myReplacements[myCode] != undefined) {
            intReplacement = myReplacements[myCode];
            str = str.substr(0,c) + String.fromCharCode(intReplacement) + str.substr(c+1);
        }
    }
    return str;
}

I figured out how to strip unwanted characters by using this function:

function removeMSWordChars(str) {
    var myReplacements = new Array();
    var myCode, intReplacement;
    myReplacements[8216] = 39;
    myReplacements[8217] = 39;
    myReplacements[8220] = 34;
    myReplacements[8221] = 34;
    myReplacements[8212] = 45;
    for(c=0; c<str.length; c++) {
        var myCode = str.charCodeAt(c);
        if(myReplacements[myCode] != undefined) {
            intReplacement = myReplacements[myCode];
            str = str.substr(0,c) + String.fromCharCode(intReplacement) + str.substr(c+1);
        }
    }
    return str;
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文