views:

46

answers:

3

I have some turkish characters at my website but I am not able to sme characters very well.There is a problem with nonenglish characters. I encoded it with UTF-8 and added some meta tags to fix this issue but the problem still seems same. Could you please look at the website (you can look at the code by using firebug) and tell me where I am doing wrong? I will be appreciated if you can guide me about the error.


Update: the website in question is: http://apps.netbiscuits.com/516904/New_Custom_Application_1/

A: 

(moved update into question, you should delete this "answer")

alper kopuz
You can (should) edit your answer to add information, rather than add an answer!
Pekka
+1  A: 

Your static content (“Kişisel”, the keywords meta) is correctly encoded as UTF-8.

The other content on the page, taken from stories on the target site, has been mis-decoded from ISO-8859-1 (Western) instead of ISO-8859-9 (Turkish), before being encoded to UTF-8.

How are you extracting that content to put on the page? Is it scraped, or from a database, or something? It's possible you've missed an encoding argument somewhere, causing Java to resort to using the system ‘default’ encoding which may be Western instead of Turkish.

bobince
Conent comes from a RSS feed which is :http://h2.haberturk.com/rss/Kisisel.xml. I put megatags everwhere to get it true but it is still same. By the way do you think i need to add meta tag which uses character set of ISO-8859-1 ( I used ISO-8859-9 Turkis before)
alper kopuz
The meta tag is fine, it's the content in the output itself that is broken. Let's see some code for how you are transferring content from the RSS file to your output.
bobince
you can see it at there bobince : http://pastebin.com/Wn9aKrRQ
alper kopuz
Do you have a `<%@page pageEncoding="UTF-8" %>` declaration? And how is the `$doc` loaded?
bobince
yes i have it at beginning of the code
alper kopuz
yes i have it bobinche.what you meant by $doc is loaded?
alper kopuz
well, how are you getting the RSS document into an XML Document object for use with the `<x:` taglib?
bobince
(Incidentally, there are problems with trying to inject a URL into the JavaScript onclick there, you really need to the JS-string-literal-encoding *and* then HTML-encoding the output. This nested string context business is bad news, which is why it's better to avoid inline event handler attributes. You would in general be better off marking each link up as a normal `<a>` link with `display: block` and using CSS float or positioning to lay out `<span>`s inside it rather than using a div and table. This is nothing to do with the encoding problem though.)
bobince
A: 

fetch.scritch.org is a good tool for encoding issues - it has an encoding tab that reports the encoding from the header, from possible http-equiv and it attempts to guess the encoding.

Ivo van der Wijk