Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Currently I have a problem with some German characters like ö,ä,ü and so on in my web part. SharePoint didn’t show these characters correctly. It just shows some crazy stuff like ö.

The Element.xml use <?xml version="1.0" encoding="utf-8"?>. The Sharepoint header uses <meta http-equiv="Content-Type" content="text/html; charset=utf-8">.

If I add a special character in the text field in SharePoint, the characters will show correctly. How could I fix this?

share|improve this question

1 Answer 1

up vote 0 down vote accepted

I think using the Unicode character set isn't enough, you'll need to change every special character with the corresponding html-code
Here's a list:
Special characters list

If you are reading the xml in c#, you could use the following to convert

string TestString = "This is a <Test String>.";
string EncodedString = HttpUtility.HtmlEncode(TestString);
//Output: This is a &lt;Test String&gt;.
share|improve this answer
    
Why i must change every special character? If i develop in php that is not necessary, if i use unicode. At the moment, the character is in asp ListItem, that is very time-consuming if i have to change every special character by myself. –  hofmeister Oct 12 '11 at 11:55
    
Do you use Visual studio? Otherwise you can search and replace all characters with one click. But you'll need to that for every special character. Another way to change it inside the asp listitems is maybe with this (didn't test it):wap.w3schools.com/asp/met_htmlencode.asp –  Ruben Herman Oct 12 '11 at 12:11
    
Yes i uses VS. Okay, then i will change every character. I thought their would be a better solution. Thanks guys. –  hofmeister Oct 13 '11 at 5:30

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.