Skip to content

Commit

Permalink
Converting file content to UTF-8
Browse files Browse the repository at this point in the history
  • Loading branch information
wiltonsr committed Apr 24, 2019
1 parent 920df38 commit 2eb30d9
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
6 changes: 5 additions & 1 deletion Controller/TrelloJSON2KanboardController.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ public function save()
if (!file_exists($filename)) {
$this->create($values, array('file' => array(t('Please select a JSON file.'))));
} else {
$jsonObj = json_decode(file_get_contents($filename));
$file_content = file_get_contents($filename);

$file_content = mb_convert_encoding($file_content, 'UTF-8', 'pass');

$jsonObj = json_decode($file_content);

if (is_null($jsonObj)) {
$this->create($values, array('file' => array(t('Unable to parse JSON file. Error: %s', json_last_error_msg()))));
Expand Down
1 change: 0 additions & 1 deletion Locale/pt_BR/translations.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
'Only public projects have users and groups management.' => 'Somente projetos públicos possuem gerenciamento de usuários e grupos.',
'Observations' => 'Observações',
'Your file must use the JSON format' => 'Seu arquivo deve usar o formato JSON',
'Your file must be encoded in UTF-8' => 'Seu arquivo deve estar codificado em UTF-8',
'The JSON file must contain the keys: name, lists, cards, checklists and actions' => 'O arquivo JSON deve conter as chaves: name, lists, cards, checklists e actions',
'Your user will be the author of the imported comments' => 'Seu usuário será o autor dos comentários importados',
'Import' => 'Importar',
Expand Down
2 changes: 1 addition & 1 deletion Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function getPluginAuthor()

public function getPluginVersion()
{
return '1.0.4';
return '1.0.5';
}

public function getPluginHomepage()
Expand Down
1 change: 0 additions & 1 deletion Template/json_import/create.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
<h3><?= t('Observations') ?></h3>
<ul>
<li><?= t('Your file must use the JSON format') ?></li>
<li><?= t('Your file must be encoded in UTF-8') ?></li>
<li><?= t('The JSON file must contain the keys: name, lists, cards, checklists and actions') ?></li>
<li><?= t('Your user will be the author of the imported comments') ?></li>
</ul>
Expand Down

0 comments on commit 2eb30d9

Please sign in to comment.