Interested to know if that solves it for you, and also I wonder if when editing Razor files in the Umbraco UI changes the encoding and removes the BOM....?
Just curious - when you see the rendered result in a browser, everything's fine, right? (i.e., you get the correct turkish characters, like Ö and Ç, I assume?)
The browser's parser doesn't see (or do) anything different for the entity reference Ç and the character Ç - they're both exactly the same thing from the parser's perspective.
I've seen lots of Tidy tools do the automatic conversion when tidying a document, which probably stems from when some popular browsers couldn't handle anything that wasn't either US-ASCII or Window-1259 encoded, so the tools just converted any "dangerous" characters to entity-references for the sake of the users.
Maybe your editor does a pre-save tidying step when you save the files?
Yes in the rendered results, browser displays everything correctly. I have tried notepadd++, sublimetext editor, notepad and umbraco's native editor, but I still get the same results.
I have discovered another thing though: when I use @item.incentiveDescription I have encoding problems
but when I use Truncate like: @(Library.Truncate(Library.StripHtml(item.incentiveDescription), 180, true)) there are no problems at encoding.
I still couldn't find the source of this problem though.
Only solution is to use @Html.Raw(abc.ToString()). But I don't know how to apply it for datetimes for example for this : @umbraco.library.FormatDateTime(umbraco.library.CurrentDate(), "MMMM") @HTML.Raw doesn't seem to work.
Could you please write in english? Unfortunately I don't understand turkish and I think a lot of others in here don't understand that either - So please let's keep this forum in english so everyone can understand each other and help each other out :)
I'm really curious what you have written above and if I maybe can help ;-)
Special Characters Problem Only on Razor
Hey,
One of my domains is in Turkish and in HTML source of the webpage all the special characters are replaced with weird numeric entities like:
<span class="exclusive">Bize Özel</span>
<h3>%70'e varan Çok Özel Sezon Indirimş</h3>
when I use dictionary items or template page fields like <umbraco:Item field="vendorTitle" runat="server" /> there are no problems at all.
Although all of my razor cshtml files are saved in utf-8 format, I have this weird characters in my HTML source.
Is there a solution for this? I am running Umbraco v6.2.1 with SQL Server
Thank you in advance
First i would look up the encoded characters and see what there value are.
Let us know what you found :)
That's an interesting issue and perhaps one not specific to Umbraco, have you seen this suggestion on Stack Overflow?
Interested to know if that solves it for you, and also I wonder if when editing Razor files in the Umbraco UI changes the encoding and removes the BOM....?
Yea i had the same thing with another project. I cannot remember the specifics but we had to save the razor files as UTF-8 with an encoding selected
Hey all,
sorry for late reply I was in a trip without laptop and didnt have time to check the answers.
I have this meta tag already in the template file: <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
I also checked all the script files with notepad++ and all of them are with BOM.
My windows 2012 server is in German, could this be the reason of it?
Hi Kadir,
Just curious - when you see the rendered result in a browser, everything's fine, right? (i.e., you get the correct turkish characters, like Ö and Ç, I assume?)
The browser's parser doesn't see (or do) anything different for the entity reference
Ç
and the characterÇ
- they're both exactly the same thing from the parser's perspective.I've seen lots of Tidy tools do the automatic conversion when tidying a document, which probably stems from when some popular browsers couldn't handle anything that wasn't either US-ASCII or Window-1259 encoded, so the tools just converted any "dangerous" characters to entity-references for the sake of the users.
Maybe your editor does a pre-save tidying step when you save the files?
/Chriztian
Hey Chriztian,
Yes in the rendered results, browser displays everything correctly. I have tried notepadd++, sublimetext editor, notepad and umbraco's native editor, but I still get the same results.
I have discovered another thing though: when I use @item.incentiveDescription I have encoding problems
but when I use Truncate like: @(Library.Truncate(Library.StripHtml(item.incentiveDescription), 180, true)) there are no problems at encoding.
I still couldn't find the source of this problem though.
Only solution is to use @Html.Raw(abc.ToString()). But I don't know how to apply it for datetimes for example for this : @umbraco.library.FormatDateTime(umbraco.library.CurrentDate(), "MMMM")
@HTML.Raw doesn't seem to work.
Kadir bey problemi çözebildiniz mi? aynı problemi bende yaşıyorum da.
Hi Ibrahim
Could you please write in english? Unfortunately I don't understand turkish and I think a lot of others in here don't understand that either - So please let's keep this forum in english so everyone can understand each other and help each other out :)
I'm really curious what you have written above and if I maybe can help ;-)
Cheers, Jan
Hi Jan.
It asks that the problem is in progress Kadir? I have the same problem too. How can I solve this problem? Can you help me?
Umbraco installation SQL Server Collation of the database is SQLLatin1GeneralCP1CIAS. Umbraco not support TurkishCI_AS.
I use Umbraco version 7.2.1 assembly: 1.0.5462.37503.
Best Regard. Thank you.
Hi
try this
Use Regex to solve this problem
hope this help
Regards
Samira
Looks like this is a "feature" of Razor that it will always HTML encode attributes. See: Razor - @Html.Raw() still encoding & in meta tag attributes.
So to work around this, you can do the following:
It's not pretty, but it works.
Source URL Address : http://sofc.developer-works.com/article/19875431/Meta+description+with+special+characters+in+Umbraco
It was tested. The problem is solved.
Thanks. Best regard.
is working on a reply...