【问题标题】:Node.Js recieving hebrew as coded string from html form (method - post)Node.Js 从 html 表单接收希伯来语作为编码字符串(方法 - 发布)
【发布时间】:2019-07-24 03:51:18
【问题描述】:

我正在使用 Node.Js 接收 HTML 表单,然后使用数据查询数据库 (in SQL) 如果数据是英文的。一切都很好,但是当我用希伯来语输入数据时,我将其作为编码字符串。 例如,希伯来语中的字符串:"עברית" 将是:"%D7%A2%D7%91%D7%A8%D7%99%D7%AA"

我已经在使用这个标签了:

"meta http-equiv="Content-Type" content="text/html; charset=utf-8" /"

【问题讨论】:

  • 在 DB 中设置列​​ Collation utf8_general_ci

标签: javascript html node.js


【解决方案1】:

我在js文件中找到了解码方法:

  function decode(str) {
            return decodeURIComponent(str.replace(/\+/g,  " "));
   }

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-07-03
    • 1970-01-01
    • 2011-11-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多