This is a migrated thread and some comments may be shown as answers.

German umlauts not working in ListView's client template when coming from resources

3 Answers 232 Views
ListView
This is a migrated thread and some comments may be shown as answers.
dbCF
Top achievements
Rank 2
dbCF asked on 01 Jul 2015, 08:51 AM

Hi,

 

I've a MVC ListView which was working perfectly until I've localized it to German. My resources are managed in Visual Studio's Resource Designer, the typical way I'd say. If any of these resources contains an umlaut and is used directly in the template, it will be converted to something like "ö". The unescaped hash sign breaks the template. I've tried several attempts to fix this issue, but none of them worked:

1.<script type="text/x-kendo-tmpl" id="recordLinesTemplate">
2.@Resources.Resources.BtnDeleteLine // "Zeile l&#246;schen"
3.@Resources.Resources.BtnDeleteLine.Replace('#', 'X') // "Zeile l&#246;schen"
4.@((Resources.Resources.BtnDeleteLine).Replace('#', 'X')) // "Zeile l&#246;schen"
5.@Resources.Resources.BtnDeleteLine.Replace("ö", "ö") // "Zeile l&amp;ouml;schen"
6.@WebUtility.HtmlEncode(Resources.Resources.BtnDeleteLine) // "Zeile l&amp;#246;schen"
7.</script>

Out of curiosity, I've tried to encode the umlaut directly in the resource, but the ampersand gets encoded as well.

Any ideas how to resolve this issue?

Beste Grüße with two umlauts,

   Carsten

3 Answers, 1 is accepted

Sort by
0
dbCF
Top achievements
Rank 2
answered on 01 Jul 2015, 08:54 AM
PS: The forth attempt is not shown correctly. I've tried to replace the "ö" with "& ouml;".
0
Accepted
Daniel
Telerik team
answered on 03 Jul 2015, 07:43 AM
Hello Carsten,

You can avoid the problem by preventing the encoding using the Html.Raw helper:
@Html.Raw(Resources.Resources.BtnDeleteLin)


Regards,
Daniel
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
dbCF
Top achievements
Rank 2
answered on 03 Jul 2015, 08:18 AM
Perfect, works like a charm! Thanks a lot.
Tags
ListView
Asked by
dbCF
Top achievements
Rank 2
Answers by
dbCF
Top achievements
Rank 2
Daniel
Telerik team
Share this question
or