zoukankan      html  css  js  c++  java
  • 腾讯微博SDK C#版本 发微博时有中文报check sign error的解决办法

    修改 synchttp.cs
    131行开始 即对content进行了特别处理 进行urldecode
    即可发中文了

                    foreach (Parameter param in listParams)
                    {
                        if (param.Name != "content")
                        {
                            string formitem = string.Format(formdataTemplate, param.Name, param.Value);
                            byte[] formitembytes = Encoding.UTF8.GetBytes(formitem);
                            memStream.Write(formitembytes, 0, formitembytes.Length);
                        }
                        else
                        {
                            string formitem = string.Format(formdataTemplate, param.Name, System.Web.HttpUtility.UrlDecode(param.Value));
                            byte[] formitembytes = Encoding.UTF8.GetBytes(formitem);
                            memStream.Write(formitembytes, 0, formitembytes.Length);

                        }

                    }


    感谢SDK作者的指导

  • 相关阅读:
    2020.05.27
    static{}静态代码块与{}普通代码块之间的区别
    Spring 注解@Autowired注解
    java:List的深拷贝
    IDEA中MAVEN无法自动加载的问题
    java Comparator接口
    JAVA ArrayList<E>
    JAVA BigInteger
    JAVA输入输出
    JAVA String,StringBuilder的一些API
  • 原文地址:https://www.cnblogs.com/rav009/p/5131226.html
Copyright © 2011-2022 走看看