This project is read-only.

HTML encoding

May 25, 2012 at 11:17 AM

Hi,

I found that this was keeping the HTML encoding on certain characters which wasn't what I needed.  I altered a line as follows:

writer.AddResource(d.Key.ToString(), HttpUtility.HtmlDecode(translatedString));

You'll need to add a reference to System.Web

regards

Tony

May 26, 2012 at 4:59 PM

If someone translates the string "Me & my wife" to German, he would expect "mich & meine Frau"

Your code will ruin that.

May 31, 2012 at 9:39 AM

HI,
Thanks for your reply - and nice bit of code by the way!

but if I wanted foreign characters then those were appearing in the browser as { rather than the character. This is because MVC HTML encodes all characters unless I tell it explicitly not to in each item which would be quite a bit of work.

Tony



From: [email removed]
To: [email removed]
Date: Sat, 26 May 2012 08:59:49 -0700
Subject: Re: HTML encoding [ResxTranslatorBot:357111]

From: jitbit
If someone translates the string "Me & my wife" to German, he would expect "mich & meine Frau"
Your code will ruin that.
Read the full discussion online.
To add a post to this discussion, reply to this email (ResxTranslatorBot@discussions.codeplex.com)
To start a new discussion for this project, email ResxTranslatorBot@discussions.codeplex.com
You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.
Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com
Jun 11, 2012 at 7:52 PM

I am using this tool for a prism desktop application.  It's really good!

 

However, I had the same trouble as tonykenny with the tool leaving unicode characters, as google translates them, to html coded strings.  The code modification Tony proposed fixed my issue.  You might consider adding it as an optional flag to convert html encoded characters to their unicode equivellent.

 

Thanks for the tool!

 

Jeffrey