Skip to content

关于乱码的问题 #8

Description

@sanbrother

你好、我想提一个Issue

虽然在构成AliPay的API的参数中指定了UTF-8
但是HttpClient传输方式没有指定成UTF-8(默认传输方式似乎是与当前系统Locale有关的值)

因此、英文以外的字符必然有乱码

2个方案:

  1. if (headers.count("Content-Type") == 0)
    

    {
    // set default charset 'UTF-8'
    headerlist = curl_slist_append(headerlist, "Content-Type: application/x-www-form-urlencoded; charset=UTF-8");
    }

  2. 调用sendSyncRequest时、指定Content-Type

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions