Discourse:添加中文用户名支持
URL的encode和decode:
Ruby:
URI.escape(foo,Regexp.new("[^#{URI::PATTERN::UNRESERVED}]"))
URI.unescape(val)
JavaScript:
encodeURIComponent(foo);
匹配中文:
\u4e00-\u9fa5A
URL的encode规则:
PATH:
space => %20
plus => plus/%2B
PARAM:
space => %20/plus
plus => %2B