使用不同的编码提交表单
我有一个页面需要将用户重定向到另一个单独的系统(我无法访问那里)。系统需要通过 POST 向其发送一些参数(例如“userId”)。问题是,我的页面采用 UTF-8,而其他系统的编码是 ISO-8859-1。
此外,处理其他系统的请求可能需要一些时间。这就是为什么在处理请求时,用户应该在我的页面中看到一些“请稍候,系统正在处理您”。
我希望它看起来最好的方式是这样的:
- 用户打开页面 A 并按 “送我到系统”。
- 用户是 显示一个页面,其中包含文字“请稍候, 您正在被处理 system”。还有隐藏的POST 表单位于正在处理的同一页面上 1 秒后发布 JavaScript。
- 当其他服务器 完成处理请求, 用户终于收到响应 我的文字被替换为 对方提供的不同页面 服务器。
问题是,我无法制作表单,因为它将以 UTF-8 格式发布数据,而其他服务器将尝试将其解析为 ISO-8859-1。
可能的解决方案有哪些?
提前致谢。
I have a page which needs to redirect a user to another separate system (I have no access there). The system requires some parameters to be sent to it via POST (for example "userId"). The problem is, that my page is in UTF-8 and the other system's encoding is ISO-8859-1.
Also, it could take some time to process the request for the other system. That's why while the request is processing, user should be seeing some "Please wait, you are being processed by the system" in my page.
The best way how I'd like it to look is something like this:
- User opens page A and presses
"Send me to System". - User is
shown a page with text "Please wait,
you are being processed by the
system". Also there's hidden POST
form on the same page that is being
posted after 1 second with
Javascript. - When the other server
finishes processing the request,
user finally receives the response
and my text is replaced with a
different page provided by the other
server.
The problem is, I can not make a form as it will post the data in UTF-8 and the other server will try to parse it as ISO-8859-1.
What are the possible solutions?
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
设法使用 iframe 来实现。 iframe 可以加载它的个人编码。
Managed to make it using iframes. Iframe can have it's personal encoding loaded.
很简单,只要让表单页面只使用ISO-8859-1编码即可。
Easy, just make the form page only use ISO-8859-1 encoding.