V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
kalsolio
V2EX  ›  问与答

Rails 为什么要使用这个对钩呢?

  •  
  •   kalsolio · 2016-07-08 14:36:01 +08:00 · 1476 次点击
    这是一个创建于 3060 天前的主题,其中的信息可能已经有所发展或是发生改变。
    <input name="utf8" type="hidden" value="✓"/>

    utf8=✓

    2 条回复    2016-07-11 15:51:53 +08:00
    kikyous
        1
    kikyous  
       2016-07-08 14:41:39 +08:00   ❤️ 1
    By default, older versions of IE (<=8) will submit form data in Latin-1 encoding if possible. By including a character that can't be expressed in Latin-1, IE is forced to use UTF-8 encoding for its form submissions, which simplifies various backend processes, for example database persistence.

    If the parameter was instead utf8=true then this wouldn't trigger the UTF-8 encoding in these browsers.

    http://programmers.stackexchange.com/questions/168751/is-the-use-of-utf8-preferable-to-utf8-true
    kalsolio
        2
    kalsolio  
    OP
       2016-07-11 15:51:53 +08:00
    @kikyous 感谢
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2631 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 04:23 · PVG 12:23 · LAX 20:23 · JFK 23:23
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.