silverstripe / silverstripe-framework

Silverstripe Framework, the MVC framework that powers Silverstripe CMS
https://www.silverstripe.org
BSD 3-Clause "New" or "Revised" License
719 stars 820 forks source link

Toast message has problems with umlauts #11089

Closed bitwingsde closed 5 months ago

bitwingsde commented 7 months ago

Affected Version

5.1.0

Description

Toast-Message cannot display umlauts like "äöüÄÖÜß" correctly. See screenshot. umlauts

Affected location

GridFieldDetailForm_ItemRequest.php Line 543. my temporary solution: 'type' => mb_convert_encoding($this->record->i18n_singular_name(), 'ISO-8859-1'),

Steps to Reproduce

Add title to data object and save.

PRs

lerni commented 6 months ago

Umlauts show fine in SiteTree-"Toasts" but are scrambled with DOs per GF. bloeg-aertikoel

lekoala commented 6 months ago

In the same line, ' character is not working well either.

image

it seems that utf8 encoded characters are not being displayed properly

lekoala commented 6 months ago

I'm also a bit confused why the link creation is a direct call to htmlspecialchars instead of using the Convert class. It seems to be that either we use the Convert class or we don't, but mixing the two approaches is really odd.

https://github.com/silverstripe/silverstripe-framework/blob/c003dfd4b16a80b9b9429b070452cf853433287d/src/Forms/GridField/GridFieldDetailForm_ItemRequest.php#L552-L576

GuySartorelli commented 5 months ago

Closing in favour of https://github.com/silverstripe/silverstripe-admin/issues/1639 which has more information in it (and is against the correct repo)