Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • G gitlabhq1
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 21
    • Issues 21
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 12
    • Merge requests 12
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • gpt
  • large_projects
  • gitlabhq1
  • Issues
  • #9963

Closed
Open
Created Jan 12, 2016 by Administrator@rootOwner

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=修改"
Assignee
Assign to
Time tracking