0

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

AmirGl
  • 1
  • 1
  • Unfortunately not since I have deep client side integration between the content of the external site and my own framework. any other solutions? – AmirGl Apr 27 '10 at 15:52

3 Answers3

0

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
  • 5,595
  • 5
  • 33
  • 39
  • 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 Apr 27 '10 at 18:52
0

Use an iframe.

<iframe src="http://www.example.com" id="second-site"></iframe>
alex
  • 479,566
  • 201
  • 878
  • 984
0

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
  • 5,595
  • 5
  • 33
  • 39