Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't seem to handle German umlauts.... #276

Closed
marcscheuner-bfh opened this issue Dec 10, 2018 · 8 comments · Fixed by #375
Closed

Can't seem to handle German umlauts.... #276

marcscheuner-bfh opened this issue Dec 10, 2018 · 8 comments · Fixed by #375

Comments

@marcscheuner-bfh
Copy link

marcscheuner-bfh commented Dec 10, 2018

I have a template that shows German first and last names - something like

{{firstname}} {{lastname}}

If I provide a name like firstname="Peter", lastname="Müller", I get this in my result string:

Peter Müller

Is there any way in Handlebars.NET to AVOID this encoding? I just want the normal text "Peter Müller" back, since I need this inside an e-mail template.......

@rexm
Copy link
Member

rexm commented Dec 10, 2018

Generally e-mail clients handle encoded characters better than the expanded character sets. It is possible to introduce your own encoder that doesn't do this, on the Configuration object, but I'd wonder why for e-mail.

@tonysneed
Copy link

This is an issue for my Handlebars scaffolding for EF Core, which in general should suppress HTML encoding.

I noticed that EncodedTextWriter has a SuppressEncoding property. Would it be possible to add this property to HandlebarsConfiguration, so that HTML encoding could be suppressed?

@tonysneed
Copy link

@rexm If you point me in the right direction, I can submit a PR for this.

@rexm
Copy link
Member

rexm commented Apr 27, 2019

HandlebarsJS has a configuration option noEscape that disables all encoding. I think a NoEscape boolean on configuration that controls/overrides the EncodedTextWriter would be appropriate.

@marcscheuner-bfh
Copy link
Author

@rexm : yes, sounds very reasonable and would increase the usefulness of Handlebars.NET - you definitely got my vote on this one!

@tonysneed
Copy link

👍 For adding this fix to the next version of Handlebars.NET.

@rexm rexm mentioned this issue Oct 2, 2019
9 tasks
oformaniuk added a commit to oformaniuk/Handlebars.Net that referenced this issue Oct 18, 2020
oformaniuk added a commit to oformaniuk/Handlebars.Net that referenced this issue Oct 19, 2020
oformaniuk added a commit to oformaniuk/Handlebars.Net that referenced this issue Oct 26, 2020
oformaniuk added a commit to oformaniuk/Handlebars.Net that referenced this issue Oct 26, 2020
oformaniuk added a commit to oformaniuk/Handlebars.Net that referenced this issue Oct 26, 2020
@tonysneed
Copy link

Is there now a NoEscape boolean on configuration?

@oformaniuk
Copy link
Member

Yes, it is available in latest master. Unfortunately it is not yet published.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants