代码之家  ›  专栏  ›  技术社区  ›  Bokambo

Uri.EscapeDataString不转换左括号和右括号

  •  0
  • Bokambo  · 技术社区  · 6 年前

    我使用的是DotNetFramework4.7.1和VS2017。 Uri.Escapestring不适用于左括号和右括号

    string str = Uri.EscapeDataString(" John ");
    Result : %20John%20 - Correct
    
    string str = Uri.EscapeDataString("(John)");
    Result : (John) - incorrect - it should be - %28John%29
    

    在我同事的机器上用同样的配置做同样的工作

    有什么帮助吗?

    0 回复  |  直到 6 年前
    推荐文章