Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3600966
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T20:33:44+00:00 2026-05-18T20:33:44+00:00

Concerning the following situation: www.foo.com is a page delivered in UTF-8. It features a

  • 0

Concerning the following situation:

http://www.foo.com is a page delivered in UTF-8. It features a login form to http://www.bar.com/Servlet. http://www.bar.com is a ISO-8859-1 capable application.

I have the following problem:

whenever someone is using special chars like German umlauts for his password the login fails because the password is posted in UTF-8, but the application expects it to be in ISO-8859-1.

Of course I could add accept-charset="ISO-8859-1" attribute to the html-form, but this (of course) does not work in IE.

I now thought of a proxy script, that is converting the UTF8 to ISO-8859-1 and posting that data to http://www.bar.com/Servlet. The conversion does work, also the posting (done by CURL). But as I’m echoing the returned html of http://www.bar.com/Servlet directly (and there is still http://www.foo.com in the address bar) the relative links in the html don’t work. I managed to add a base tag to the output with an ugly replacement and it seems to work, but it’s not a very elegant solution.

Is there a more simple way to post UTF-8-data to a ISO-8859-1 application?

My CURL code looks like this:

define('POSTURL', 'https://www.bar.com/Servlet');

array_map('utf8_decode', $_POST);

$ch = curl_init(POSTURL);
curl_setopt ($ch, CURLOPT_POST, 1);
curl_setopt ($ch, CURLOPT_POSTFIELDS, http_build_query($_POST));
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookie.txt');
curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookie.txt');

$response = curl_exec($ch);
curl_close ($ch);

$response = preg_replace('/(<head(.*)>)/U', "$1<base href=\"https://www.bar.com\" />", $response);
echo $response;

exit;
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T20:33:44+00:00Added an answer on May 18, 2026 at 8:33 pm

    I did not find a simple working solution. My solution is now to move the UTF-8-form that gets posted into an iframe on the same page and setting the charset to ISO-8859-1 within this iframe. The iframe-form posts to target=”_top” then.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Concerning the following situation: www.foo.com is a page delivered in UTF-8. It features a
I have the following doubt concerning which exception to throw if list is empty
Recently I attended a lecture concerning some design patterns: The following code had been
In the documentation concerning Fixtures ( http://api.rubyonrails.org/classes/Fixtures.html ) they provide the following example of
My question is concerning SQL connection status, load, etc. based on the following code:
I need help concerning following code: http://jsfiddle.net/8PsdE/ <SELECT ID=pizzasize NAME=pizzasize> <OPTION VALUE=s>small <OPTION VALUE=m>medium
I have the following JQuery Code concerning my tabs : $(#onglet>ul>li).click(function(){ $(#onglet ul li).removeClass('Selectionne').addClass(OngletPrincipal);
concerning the following piece of code : StaticEnum.h #pragma once #include <string> class StaticEnum
Following up on my previous question concerning the Windows 7 taskbar , I would
I have a problem with Visual Studio 2008 concerning virtual inheritance. Consider the following

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.