mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-23 14:00:56 +01:00
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
This commit is contained in:
parent
3e29921f5e
commit
df3162584e
1 changed files with 11 additions and 1 deletions
|
@ -27,7 +27,17 @@ abstract class DiffusionFileContentQuery extends DiffusionQuery {
|
|||
}
|
||||
|
||||
final public function loadFileContent() {
|
||||
return $this->fileContent = $this->executeQuery();
|
||||
$this->fileContent = $this->executeQuery();
|
||||
|
||||
$repository = $this->getRequest()->getRepository();
|
||||
$try_encoding = $repository->getDetail('encoding');
|
||||
if ($try_encoding) {
|
||||
$this->fileContent->setCorpus(
|
||||
phutil_utf8_convert(
|
||||
$this->fileContent->getCorpus(), "UTF-8", $try_encoding));
|
||||
}
|
||||
|
||||
return $this->fileContent;
|
||||
}
|
||||
|
||||
final public function getRawData() {
|
||||
|
|
Loading…
Reference in a new issue