惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

有赞技术团队
有赞技术团队
小众软件
小众软件
The Cloudflare Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园_首页
酷 壳 – CoolShell
酷 壳 – CoolShell
爱范儿
爱范儿
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
雷峰网
雷峰网
Jina AI
Jina AI
博客园 - 【当耐特】
V
Visual Studio Blog
美团技术团队
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
罗磊的独立博客
大猫的无限游戏
大猫的无限游戏
量子位
IT之家
IT之家
G
Google Developers Blog
V
V2EX
The GitHub Blog
The GitHub Blog
月光博客
月光博客
GbyAI
GbyAI

博客园 - 小灰灰开始整活儿啦

喔去,litellm 竟然被投毒了,赶紧检查你的机器中招了没有 KMP跨平台开发中的现状调研 [随记]iphone加粗字体 .net 序列化反序列化小节 如何获得毫秒级时间(iphone) Mac os 截屏快捷键 消灭Warning 'ClassName' may not respond to '-funcName:args' 给xcode设置快捷键 - 小灰灰开始整活儿啦 - 博客园 [转]iPhone系统常用文件夹位置 Xcode 快捷键全集[转] iphone中如何进行多线程编程[转] NSString详细介绍 Iphone UILabel显示多行文本的方法 iPhone上的JSON[转] Iphone dev -json-1- Transfer json data by Http Submitting HTTP Requests (iPhone) 不支持js的(wap2.0)手机清单 HTC 手机的'Length Require的Bug [编程点滴]将string 转化成enum最简单的办法。
Safe characters for friendly url
小灰灰开始整活儿啦 · 2010-08-09 · via 博客园 - 小灰灰开始整活儿啦

The format for an URI is defined in RFC 3986. See section 3.3 for details.

 -------------------

You are best keeping only some characters (whitelist) instead of removing certain characters (blacklist).

You can technically allow any character, just as long as you properly encode it. But, to answer in the spirit of the question, you should only allow these characters:

  1. Lower case letters (convert upper case to lower)
  2. Numbers, 0 through 9
  3. A dash - or underscore _(在将一些字串转成base64时,我一般将/转成_,+转成-)
  4. Tilda ~ 

Everything else has a potentially special meaning. For example, you may think you can use +, but it can be replaced with a space. & is dangerous, too, especially if using some rewrite rules.

As with the other comments, check out the standards and specifications for complete details.