@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Convert to custom encoding for diffusion blame views

Summary:
If a repository is configured with a custom encoding, it wasn't respected by DiffusionGitFileContentQuery making all views with
non-UTF8 characters fail. Check if we have a custom encoding and encode if any it set.

NOTE: This only works for Git repositories.

Test Plan: Browsed a repository with custom encoding before and after this patch.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T452

Differential Revision: https://secure.phabricator.com/D3251

authored by

David Reuss and committed by
epriestley
df316258 3e29921f

+11 -1
+11 -1
src/applications/diffusion/query/filecontent/DiffusionFileContentQuery.php
··· 27 27 } 28 28 29 29 final public function loadFileContent() { 30 - return $this->fileContent = $this->executeQuery(); 30 + $this->fileContent = $this->executeQuery(); 31 + 32 + $repository = $this->getRequest()->getRepository(); 33 + $try_encoding = $repository->getDetail('encoding'); 34 + if ($try_encoding) { 35 + $this->fileContent->setCorpus( 36 + phutil_utf8_convert( 37 + $this->fileContent->getCorpus(), "UTF-8", $try_encoding)); 38 + } 39 + 40 + return $this->fileContent; 31 41 } 32 42 33 43 final public function getRawData() {