{"action":"created","issue":{"url":"https://api.github.com/repos/gollum/gollum/issues/843","labels_url":"https://api.github.com/repos/gollum/gollum/issues/843/labels{/name}","comments_url":"https://api.github.com/repos/gollum/gollum/issues/843/comments","events_url":"https://api.github.com/repos/gollum/gollum/issues/843/events","html_url":"https://github.com/gollum/gollum/issues/843","id":38919415,"number":843,"title":"incompatible character encodings: UTF-8 and ASCII-8BIT","user":{"login":"schmunk42","id":649031,"avatar_url":"https://avatars.githubusercontent.com/u/649031?v=3","gravatar_id":"","url":"https://api.github.com/users/schmunk42","html_url":"https://github.com/schmunk42","followers_url":"https://api.github.com/users/schmunk42/followers","following_url":"https://api.github.com/users/schmunk42/following{/other_user}","gists_url":"https://api.github.com/users/schmunk42/gists{/gist_id}","starred_url":"https://api.github.com/users/schmunk42/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/schmunk42/subscriptions","organizations_url":"https://api.github.com/users/schmunk42/orgs","repos_url":"https://api.github.com/users/schmunk42/repos","events_url":"https://api.github.com/users/schmunk42/events{/privacy}","received_events_url":"https://api.github.com/users/schmunk42/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/gollum/gollum/labels/bug","name":"bug","color":"ff3636"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":20,"created_at":"2014-07-28T18:41:00Z","updated_at":"2015-01-05T17:35:22Z","closed_at":"2015-01-03T22:01:51Z","body":"I am having the following error, when editing pages via gollum, which were modified with an editor (PHPstorm or Mou) and pushed back into the wiki repo - and there as usually located two levels (folders) below root.\r\n\r\n```\r\nEncoding::CompatibilityError at /edit/my-page\r\nincompatible character encodings: UTF-8 and ASCII-8BIT\r\n\r\nfile: index.rb location: % line: 176\r\n```\r\n\r\nI've looked through several encoding issues I've found [here](https://github.com/gollum/gollum/search?q=encoding&ref=cmdform&type=Issues). And came to the conclusion, that this is an error with `grit` (fork from gitlab).\r\n\r\nI've tried different version of ruby (1.9.3, 2.1.2) and gollum (2.1.0, 2.5.0, 3.0.0) to fix the problem, but the only way (for me) to work around this issue, was modifiying [this line](https://github.com/gitlabhq/grit/blob/c2541d93618f0dfcfc8cfeeddb74b07ac6d520c2/lib/grit/index.rb#L176) to:\r\n\r\n```\r\ntree_contents[k] = \"%s %s\\0%s\" % [tmode, obj.name.force_encoding('ASCII-8BIT'), sha]\r\n```\r\n\r\nWhich does not really look right to me. \r\nIs there any way to fix this in gollum or even via `config.rb`?\r\n\r\n\r\nError Stacktrace:\r\n```\r\nlocalhost - - [28/Jul/2014:19:31:17 CEST] \"GET /javascript/editor/langs/markdown.js?_=1406568677805 HTTP/1.1\" 200 11837\r\nhttp://localhost:4567/edit/intern/orga/my-page -> /javascript/editor/langs/markdown.js?_=1406568677805\r\nEncoding::CompatibilityError - incompatible character encodings: UTF-8 and ASCII-8BIT:\r\n\t/opt/local/lib/ruby1.9/gems/1.9.1/gems/gitlab-grit-2.6.7/lib/grit/index.rb:176:in `%'\r\n\t/opt/local/lib/ruby1.9/gems/1.9.1/gems/gitlab-grit-2.6.7/lib/grit/index.rb:176:in `block in write_tree'\r\n\t/opt/local/lib/ruby1.9/gems/1.9.1/gems/gitlab-grit-2.6.7/lib/grit/index.rb:171:in `each'\r\n\t/opt/local/lib/ruby1.9/gems/1.9.1/gems/gitlab-grit-2.6.7/lib/grit/index.rb:171:in `write_tree'\r\n\t/opt/local/lib/ruby1.9/gems/1.9.1/gems/gitlab-grit-2.6.7/lib/grit/index.rb:198:in `block in write_tree'\r\n\t/opt/local/lib/ruby1.9/gems/1.9.1/gems/gitlab-grit-2.6.7/lib/grit/index.rb:180:in `each'\r\n\t/opt/local/lib/ruby1.9/gems/1.9.1/gems/gitlab-grit-2.6.7/lib/grit/index.rb:180:in `write_tree'\r\n\t/opt/local/lib/ruby1.9/gems/1.9.1/gems/gitlab-grit-2.6.7/lib/grit/index.rb:198:in `block in write_tree'\r\n\t/opt/local/lib/ruby1.9/gems/1.9.1/gems/gitlab-grit-2.6.7/lib/grit/index.rb:180:in `each'\r\n\t/opt/local/lib/ruby1.9/gems/1.9.1/gems/gitlab-grit-2.6.7/lib/grit/index.rb:180:in `write_tree'\r\n\t/opt/local/lib/ruby1.9/gems/1.9.1/gems/gitlab-grit-2.6.7/lib/grit/index.rb:123:in `commit'\r\n\t/opt/local/lib/ruby1.9/gems/1.9.1/gems/gollum-lib-3.0.0/lib/gollum-lib/committer.rb:170:in `commit'\r\n\t/opt/local/lib/ruby1.9/gems/1.9.1/gems/gollum-3.0.0/lib/gollum/app.rb:248:in `block in <class:App>'\r\n\t/opt/local/lib/ruby1.9/gems/1.9.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1603:in `call'\r\n\t/opt/local/lib/ruby1.9/gems/1.9.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1603:in `block in compile!'\r\n\t/opt/local/lib/ruby1.9/gems/1.9.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:966:in `[]'\r\n\t/opt/local/lib/ruby1.9/gems/1.9.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:966:in `block (3 levels) in route!'\r\n\t/opt/local/lib/ruby1.9/gems/1.9.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:985:in `route_eval'\r\n\t/opt/local/lib/ruby1.9/gems/1.9.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:966:in `block (2 levels) in route!'\r\n\t/opt/local/lib/ruby1.9/gems/1.9.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1006:in `block in process_route'\r\n\t/opt/local/lib/ruby1.9/gems/1.9.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1004:in `catch'\r\n\t/opt/local/lib/ruby1.9/gems/1.9.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1004:in `process_route'\r\n\t/opt/local/lib/ruby1.9/gems/1.9.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:964:in `block in route!'\r\n\t/opt/local/lib/ruby1.9/gems/1.9.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:963:in `each'\r\n\t/opt/local/lib/ruby1.9/gems/1.9.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:963:in `route!'\r\n\t/opt/local/lib/ruby1.9/gems/1.9.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1076:in `block in dispatch!'\r\n\t/opt/local/lib/ruby1.9/gems/1.9.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1058:in `block in invoke'\r\n\t/opt/local/lib/ruby1.9/gems/1.9.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1058:in `catch'\r\n\t/opt/local/lib/ruby1.9/gems/1.9.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1058:in `invoke'\r\n\t/opt/local/lib/ruby1.9/gems/1.9.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1073:in `dispatch!'\r\n\t/opt/local/lib/ruby1.9/gems/1.9.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:898:in `block in call!'\r\n\t/opt/local/lib/ruby1.9/gems/1.9.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1058:in `block in invoke'\r\n\t/opt/local/lib/ruby1.9/gems/1.9.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1058:in `catch'\r\n\t/opt/local/lib/ruby1.9/gems/1.9.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1058:in `invoke'\r\n\t/opt/local/lib/ruby1.9/gems/1.9.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:898:in `call!'\r\n\t/opt/local/lib/ruby1.9/gems/1.9.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:886:in `call'\r\n\t/opt/local/lib/ruby1.9/gems/1.9.1/gems/rack-protection-1.5.3/lib/rack/protection/xss_header.rb:18:in `call'\r\n\t/opt/local/lib/ruby1.9/gems/1.9.1/gems/rack-protection-1.5.3/lib/rack/protection/path_traversal.rb:16:in `call'\r\n\t/opt/local/lib/ruby1.9/gems/1.9.1/gems/rack-protection-1.5.3/lib/rack/protection/json_csrf.rb:18:in `call'\r\n\t/opt/local/lib/ruby1.9/gems/1.9.1/gems/rack-protection-1.5.3/lib/rack/protection/base.rb:49:in `call'\r\n\t/opt/local/lib/ruby1.9/gems/1.9.1/gems/rack-protection-1.5.3/lib/rack/protection/base.rb:49:in `call'\r\n\t/opt/local/lib/ruby1.9/gems/1.9.1/gems/rack-protection-1.5.3/lib/rack/protection/frame_options.rb:31:in `call'\r\n\t/opt/local/lib/ruby1.9/gems/1.9.1/gems/rack-1.5.2/lib/rack/nulllogger.rb:9:in `call'\r\n\t/opt/local/lib/ruby1.9/gems/1.9.1/gems/rack-1.5.2/lib/rack/head.rb:11:in `call'\r\n\t/opt/local/lib/ruby1.9/gems/1.9.1/gems/sinatra-1.4.5/lib/sinatra/show_exceptions.rb:21:in `call'\r\n\t/opt/local/lib/ruby1.9/gems/1.9.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:180:in `call'\r\n\t/opt/local/lib/ruby1.9/gems/1.9.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:2014:in `call'\r\n\t/opt/local/lib/ruby1.9/gems/1.9.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1478:in `block in call'\r\n\t/opt/local/lib/ruby1.9/gems/1.9.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1788:in `synchronize'\r\n\t/opt/local/lib/ruby1.9/gems/1.9.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1478:in `call'\r\n\t/opt/local/lib/ruby1.9/gems/1.9.1/gems/rack-1.5.2/lib/rack/handler/webrick.rb:60:in `service'\r\n\t/opt/local/lib/ruby1.9/1.9.1/webrick/httpserver.rb:138:in `service'\r\n\t/opt/local/lib/ruby1.9/1.9.1/webrick/httpserver.rb:94:in `run'\r\n\t/opt/local/lib/ruby1.9/1.9.1/webrick/server.rb:191:in `block in start_thread'\r\n```"},"comment":{"url":"https://api.github.com/repos/gollum/gollum/issues/comments/68743862","html_url":"https://github.com/gollum/gollum/issues/843#issuecomment-68743862","issue_url":"https://api.github.com/repos/gollum/gollum/issues/843","id":68743862,"user":{"login":"bennibu","id":32865,"avatar_url":"https://avatars.githubusercontent.com/u/32865?v=3","gravatar_id":"","url":"https://api.github.com/users/bennibu","html_url":"https://github.com/bennibu","followers_url":"https://api.github.com/users/bennibu/followers","following_url":"https://api.github.com/users/bennibu/following{/other_user}","gists_url":"https://api.github.com/users/bennibu/gists{/gist_id}","starred_url":"https://api.github.com/users/bennibu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bennibu/subscriptions","organizations_url":"https://api.github.com/users/bennibu/orgs","repos_url":"https://api.github.com/users/bennibu/repos","events_url":"https://api.github.com/users/bennibu/events{/privacy}","received_events_url":"https://api.github.com/users/bennibu/received_events","type":"User","site_admin":false},"created_at":"2015-01-05T17:35:22Z","updated_at":"2015-01-05T17:35:22Z","body":"@dometto Thanks for the new adapter. It seems to work fine on my ubuntu 14.04. But when I deploy on my server (debian squeeze, git 1.7.10.4) I got a the error `Rugged::ConfigError: Config value 'user.name' was not found` when creating a new wiki page. I can't reproduce this error on my local machine (ubuntu 14.04), but as the git version differs I assume this is related? Any Idea?"}}