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

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

  •  
  •   kalsolio · 2016-07-08 14:36:01 +08:00 · 1483 次点击
    这是一个创建于 3071 天前的主题,其中的信息可能已经有所发展或是发生改变。
    <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   ·   实用小工具   ·   5873 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 20ms · UTC 02:37 · PVG 10:37 · LAX 18:37 · JFK 21:37
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.