Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 26 additions & 2 deletions lib/Service/Install/ConfigureCheckService.php
Original file line number Diff line number Diff line change
Expand Up @@ -437,11 +437,35 @@ private function checkJava(): array {
];
}
if (!str_contains($matches['encoding'], 'UTF-8')) {
$detectedEncoding = trim($matches['encoding']);
$phpLocale = setlocale(LC_CTYPE, 0);
$phpLcAll = getenv('LC_ALL');
$phpLang = getenv('LANG');

$tip = sprintf(
"Java detected encoding \"%s\" but UTF-8 is required.\n\n"
. "**Current PHP environment:**\n"
. "- LC_CTYPE: %s\n"
. "- LC_ALL: %s\n"
. "- LANG: %s\n\n"
. "**To fix this issue:**\n"
. "1. Set LC_ALL and LANG environment variables (e.g., LC_ALL=en_US.UTF-8) for your web server user\n"
. "2. Restart your web server after making changes\n"
. "3. Verify with command: `locale charmap` (should return UTF-8)\n\n"
. 'For more details, see: [Issue #4872](https://github.com/LibreSign/libresign/issues/4872)',
$detectedEncoding,
$phpLocale ?: 'not set',
$phpLcAll ?: 'not set',
$phpLang ?: 'not set'
);
return $this->result['java'] = [
(new ConfigureCheckHelper())
->setInfoMessage('Non-UTF-8 encoding detected. This may cause issues with accented or special characters')
->setInfoMessage(sprintf(
'Non-UTF-8 encoding detected: %s. This may cause issues with accented or special characters',
$detectedEncoding
))
->setResource('java')
->setTip(' Ensure the system encoding is UTF-8. You can check it using: locale charmap'),
->setTip($tip),
];
}
return $this->result['java'] = [
Expand Down
11 changes: 10 additions & 1 deletion src/views/Settings/ConfigureCheck.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
</td>
<td v-html="row.message" />
<td>{{ row.resource }}</td>
<td>{{ row.tip }}</td>
<td class="tip-cell">
<NcRichText :text="row.tip" :autolink="true" :use-markdown="true" />
</td>
</tr>
</tbody>
</table>
Expand All @@ -29,13 +31,15 @@
<script>
import { translate as t } from '@nextcloud/l10n'

import NcRichText from '@nextcloud/vue/dist/Components/NcRichText.js'
import NcSettingsSection from '@nextcloud/vue/components/NcSettingsSection'

import { useConfigureCheckStore } from '../../store/configureCheck.js'

export default {
name: 'ConfigureCheck',
components: {
NcRichText,
NcSettingsSection,
},
setup() {
Expand All @@ -61,4 +65,9 @@ table {
.info {
color: orange;
}
.tip-cell {
white-space: normal;
word-wrap: break-word;
max-width: 500px;
}
</style>
Loading