views:

44

answers:

3

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
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
A: 

Use an iframe.

<iframe src="http://www.example.com" id="second-site"></iframe>
alex
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