将两个内容编码部分合并在一个页面中

发布于 2024-08-30 17:58:42 字数 179 浏览 1 评论 0原文

我开发了一个网络应用程序,允许用户修改现有网页。 当用户输入现有网页的 url 时,我会读取该页面的内容并使用 ajax 调用,在我的 Web 应用程序内的 div 中显示内容。 现在我的问题是现有网页的内容编码通常与我的网络应用程序不同(我使用utf-8) 有没有一种方法可以使用与主页不同的内容编码的ajax调用来加载内容? 谢谢, 阿米尔

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

我偏爱纯白色 2024-09-06 17:58:42

您唯一的选择是iframe(正如亚历克斯所说)。编码是每个 html 文档唯一的元数据。

如果您的页面需要 2 种不同的编码,您将需要 2 个不同的 html 文档。

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.

知你几分 2024-09-06 17:58:42

使用iframe

<iframe src="http://www.example.com" id="second-site"></iframe>

Use an iframe.

<iframe src="http://www.example.com" id="second-site"></iframe>
吐个泡泡 2024-09-06 17:58:42

不久前,我使用这个脚本将我的 LaTeX 文件从 ISO 转换为 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

注意: 这个答案是对 AmirGl 评论的回复。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文