.net UrlEncode - lowercase problem

后端 未结 7 987
梦如初夏
梦如初夏 2020-11-27 19:56

I\'m working on a data transfer for a gateway which requires me to send data in UrlEncoded form. However, .net\'s UrlEncode creates lowercase tags, and it breaks the transfe

7条回答
  •  栀梦
    栀梦 (楼主)
    2020-11-27 20:34

    if anyone else gets here in search for perl code or a PCRE (perl-compatible regular expression) to solve the issue, a (candidate for the shortest possible) perl-expression to convert url-encoding to lowercase hex is:

    s/%(\X{2})/%\L$1\E/go
    

    and the other way around (lowercase to uppercase)

    s/%(\x{2})/%\U$1\E/go
    

提交回复
热议问题