I developed a web application that allows users to modify existing web pages. When a user type a url of an existing web page, I read the content of this page and using an ajax call, i display the content in a div inside my web application. Now my problem is that often the content encoding of the existing web page is different than my web app (I use utf-8) Is there a way to load content using an ajax call with different content encoding than the one of the main page? Thanks, Amir
A:
Your only option is an iframe
(as alex said). Encoding is a meta data that is unique for each html document.
If you need 2 different encodings on your page you will need 2 different html documents.
Rui Carneiro
2010-04-27 09:06:22
Thanks Rui and Alex.Since I can't use an iFrame, I guess my only option is to use UTF-8 for my main app and convert the other content to UTF-8 on the server side. Does anyone know how to do it?Thanks,Amir
AmirGl
2010-04-27 18:52:25
A:
Use an iframe
.
<iframe src="http://www.example.com" id="second-site"></iframe>
alex
2010-04-27 14:32:43
A:
Sometime ago i used this script to convert my LaTeX files from ISO to UTF-8:
#!/bin/sh
FILES=*.tex
for f in $FILES; do
iconv --to-code=ISO-8859-1 --from-code=UTF-8 $f > iso/$f
done
Note: this answer is a reply to AmirGl comment.
Rui Carneiro
2010-05-03 12:05:47