diff options
author | Eric Wong <e@80x24.org> | 2016-01-18 23:44:40 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2016-04-05 18:58:27 +0000 |
commit | 66ad0a45c58ed63ec16a35f41f3eda7cb8917c50 (patch) | |
tree | 2509177a625278adec3ae7c64a4c367757f97e58 /lib/PublicInbox/RepobrowseGitBlob.pm | |
parent | fa8e2e7e001d7585d6e41c254ee4443a1672bca5 (diff) | |
download | public-inbox-66ad0a45c58ed63ec16a35f41f3eda7cb8917c50.tar.gz |
We'll be UTF-8 imperialists for now and assume all of our textual output is UTF-8 for the benefit of browsers.
Diffstat (limited to 'lib/PublicInbox/RepobrowseGitBlob.pm')
-rw-r--r-- | lib/PublicInbox/RepobrowseGitBlob.pm | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/PublicInbox/RepobrowseGitBlob.pm b/lib/PublicInbox/RepobrowseGitBlob.pm index e890ae84..f2b38a0c 100644 --- a/lib/PublicInbox/RepobrowseGitBlob.pm +++ b/lib/PublicInbox/RepobrowseGitBlob.pm @@ -27,7 +27,7 @@ sub call_git_blob { if ($type eq 'blob') { $type = git_blob_mime_type($self, $req, $cat, \$buf, \$left); } elsif ($type eq 'commit' || $type eq 'tag') { - $type = 'text/plain'; + $type = 'text/plain; charset=UTF-8'; } else { $type = 'application/octet-stream'; } @@ -49,7 +49,8 @@ sub git_blob_mime_type { return; } $$left -= $r; - (index($buf, "\0") < 0) ? 'text/plain' : 'application/octet-stream'; + (index($buf, "\0") < 0) ? 'text/plain; charset=UTF-8' + : 'application/octet-stream'; } sub git_blob_stream_response { |