百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
U

utf8-cleaner

> 编程语言
开源

UTF8Cleaner 中间件可从环境中移除无效的 UTF-8 字符,以免您的应用程序因为这些字符而卡死。可防止错误发生...

281 stars0 点赞2 次浏览
访问官网GitHub

工具介绍

UTF8Cleaner 中间件可从环境中移除无效的 UTF-8 字符,以免您的应用程序因为这些字符而卡死。可防止错误发生...

UTF8Cleaner

Rack middleware to remove invalid UTF-8 characters from the environment so that your app doesn't choke on them. Prevents errors like "invalid byte sequence in UTF-8".

Installation

Add this line to your application's Gemfile:

ruby
gem 'utf8-cleaner'

If you're not running Rails, you'll have to add the middleware to your config.ru:

ruby
require 'utf8-cleaner'
use UTF8Cleaner::Middleware

Usage

There's nothing to "use". It just works!

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Credits

  • Original middleware author: @phoet - https://gist.github.com/phoet/1336754
  • Ruby 1.9.3 compatibility: @pithyless - https://gist.github.com/pithyless/3639014
  • Code review and cleanup: @nextmat
  • POST body sanitization: @salrepe
  • Bug fixes: @cosine
  • Rails 5 deprecation fix: @benlovell
  • Rack 3 support: @johnnyshields

Issues· 4 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Ruby

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言