V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
git
Pro Git
Atlassian Git Tutorial
Pro Git 简体中文翻译
GitX
shuxiao9058
V2EX  ›  git

问个问题, windows 下 git bash 使用 curl 下载或 post data 的时候为 unicode,怎么设置 utf-8?

  •  
  •   shuxiao9058 · 2014-12-26 14:42:08 +08:00 · 6432 次点击
    这是一个创建于 3399 天前的主题,其中的信息可能已经有所发展或是发生改变。

    使用如下命令也无效啊,麻烦告知下哈。。。

    curl -H "Content-Type: application/x-www-form-urlencoded; charset=UTF-8"

    5 条回复    2014-12-28 09:10:56 +08:00
    imn1
        1
    imn1  
       2014-12-26 14:59:35 +08:00
    DOS么?这个随系统,可以先输入chcp 65001回车,这样dos系统就 临时 改成cp65001(相当于utf-8)了
    如果在其他环境发命令,就要看那个环境的设置
    shuxiao9058
        2
    shuxiao9058  
    OP
       2014-12-26 19:58:30 +08:00
    @imn1 这个方法好像没有用,我要用curl工具,但是header里已经设置字符集编码了,可是传过去还是unicode编码的。
    imn1
        3
    imn1  
       2014-12-26 20:04:45 +08:00
    其实我是没搞清你说的unicode指的是什么,unicode不是一种编码,是一个集合的名称,utf-8, utf-16, utf-32这些才是编码,而且网络传输是字节,无关编码,接收方转换,或者发送前转换好再发送
    lujiajing1126
        4
    lujiajing1126  
       2014-12-27 17:29:18 +08:00
    utf-8也是unicode标准的一种- -
    你是窗口显示问题还是存成文件还有问题。。。
    shuxiao9058
        5
    shuxiao9058  
    OP
       2014-12-28 09:10:56 +08:00
    @lujiajing1126 显示的问题吧,我感觉,但是网络发送的编码格式也不对。说错了,是ANSI格式编码。。。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   948 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 21:08 · PVG 05:08 · LAX 14:08 · JFK 17:08
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.