Skip to content
GitLab
项目 群组 主题 代码片段
  • /
  • 帮助
    • 帮助
    • 支持
    • 社区论坛
    • 提交反馈
  • 登录
  • L large
  • 项目信息
    • 项目信息
    • 动态
    • 标记
    • 成员
  • 仓库
    • 仓库
    • 文件
    • 提交
    • 分支
    • 标签
    • 贡献者统计
    • 分支图
    • 比较修订版本
  • 议题 21
    • 议题 21
    • 列表
    • 看板
    • 服务台
    • 里程碑
  • 合并请求 12
    • 合并请求 12
  • CI/CD
    • CI/CD
    • 流水线
    • 作业
    • 产物
    • 计划
  • 部署
    • 部署
    • 环境
    • 发布
  • 软件包与镜像库
    • 软件包与镜像库
    • 软件包库
    • 容器镜像库
    • Terraform 模块
    • 模型实验
  • 监控
    • 监控
    • 事件
  • 分析
    • 分析
    • 价值流
    • CI/CD
    • 仓库
  • Wiki
    • Wiki
  • 代码片段
    • 代码片段
  • 动态
  • 分支图
  • 创建新议题
  • 作业
  • 提交
  • 议题看板
收起侧边栏
  • 王权利
  • large
  • 议题
  • #9963

Encoding::CompatibilityError (incompatible character encodings: ASCII-8BIT and UTF-8):

Created by: huacnlee

Encoding::CompatibilityError (incompatible character encodings: ASCII-8BIT and UTF-8):
  lib/banzai/filter/reference_filter.rb:169:in `block in replace_link_nodes_with_href'
  lib/banzai/filter/reference_filter.rb:161:in `replace_link_nodes_with_href'
  lib/banzai/filter/user_reference_filter.rb:56:in `call'
  lib/banzai/pipeline/base_pipeline.rb:24:in `block (2 levels) in singleton class'
  lib/banzai/renderer.rb:33:in `render_result'
  lib/banzai/renderer.rb:63:in `cacheless_render'
  lib/banzai/renderer.rb:28:in `render'
  lib/banzai.rb:3:in `render'
  app/helpers/gitlab_markdown_helper.rb:53:in `markdown'
  app/helpers/application_helper.rb:223:in `render_markup'
  app/helpers/tree_helper.rb:28:in `render_readme'
  app/views/projects/_readme.html.haml:8:in `block in _app_views_projects__readme_html_haml__24078851049771230_69895952334220'
  app/views/projects/_readme.html.haml:7:in `_app_views_projects__readme_html_haml__24078851049771230_69895952334220'
  app/views/projects/show.html.haml:71:in `_app_views_projects_show_html_haml___2846687072891198413_69896035096560'
  app/controllers/projects_controller.rb:106:in `block (2 levels) in show'
  app/controllers/projects_controller.rb:96:in `show'

Branch: 8-3-stable Bad content:

http://demo.somehost.com/system/ids_extracted/ef/1e/03/55/4e8e228c344ff3430b83ec01/%E4%BA%B2%E5%AF%86%E4%BB%9814-4-30/index.html#p=修改
irb(main):006:0> URI.decode('http://demo.somehost.com/system/ids_extracted/ef/1e/03/55/4e8e228c344ff3430b83ec01/%E4%BA%B2%E5%AF%86%E4%BB%9814-4-30/index.html#p=修改')
Encoding::CompatibilityError: incompatible character encodings: ASCII-8BIT and UTF-8

There have an unescaped chars in URL, but that is user generate content, we can't control it.

If use CGI.unescape, it can work:

irb(main):012:0> CGI.unescape('http://demo.somehost.com/system/ids_extracted/ef/1e/03/55/4e8e228c344ff3430b83ec01/%E4%BA%B2%E5%AF%86%E4%BB%9814-4-30/index.html#p=修改')
=> "http://demo.somehost.com/system/ids_extracted/ef/1e/03/55/4e8e228c344ff3430b83ec01/亲密付14-4-30/index.html#p=修改"
指派人
分配到
工时统计