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 6797775
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T18:39:01+00:00 2026-05-26T18:39:01+00:00

My application is able to send the input of several textfields to a PHP

  • 0

My application is able to send the input of several textfields to a PHP script on my server using the POST function which sends the message to my email. The problem is, some characters won’t get ‘translated’. For example: ü -> ü.

I have already checked my HTTP Header but it’s still UTF-8.

I also use this code to convert the characters:

[textFieldName.text stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding]

NSData *postData = [post dataUsingEncoding:NSUTF8StringEncoding allowLossyConversation:YES];

What am I doing wrong? Even the PHP file has this code:

function mail_utf8($to,$subject = '(No subject)',$message = '',$header = ''){
    $header_ = 'MIME-Version: 1.0' . "\r\n" . 'Content-type: text/plain; charset=UTF-8' . "\r\n";
    if(mail($to, '=?UTF-8?B?'.base64_encode($subject).'?=', $message, $header_ . $header)) return true;
    else return false;
  }

EDIT:

NSString *post = nil;
            post = [[NSString alloc] initWithFormat:@"vorname=%@&name=%@&plz=%@&ort=%@&email=%@&geburtsdatum=%@&eventdatum=%@",
                    [textFieldVorname.text stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding],
                    [textFieldName.text stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding],
                    [textFieldPLZ.text stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding],
                    [textFieldOrt.text stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding],
                    [textFieldEmail.text stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding],
                    [textFieldGeburtsdatum.text stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding],
                    [textFieldEventdatum.text stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
            NSData *postData = [post dataUsingEncoding:NSUTF8StringEncoding allowLossyConversion:YES];
            NSString *postLength = [NSString stringWithFormat:@"%d", [postData length]];
            NSMutableURLRequest *request = [[NSMutableURLRequest alloc] init];
            [request setURL:[NSURL URLWithString:@"http://www.url.com/document-send.php"]];
            [request setHTTPMethod:@"POST"];
            [request setValue: postLength forHTTPHeaderField:@"Content-Length"];
            [request setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"];
            [request setHTTPBody:postData];
            [NSURLConnection connectionWithRequest:request delegate:self];
  • 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-26T18:39:02+00:00Added an answer on May 26, 2026 at 6:39 pm

    Okay, I found the error:

    Like Peter Hosey said: the error was in decoding the utf-8 character set to ISO 8859-1 in php. Now this is the working code:

    mail($email_to,$email_subject,utf8_decode($email_data),$email_header);
    

    Thank you guys for helping me 🙂

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

Sidebar

Related Questions

I need to build Android application using Java which is able to send request
I am using Ajax POST method to send data, but i am not able
I need to send a POST request to a web server and be able
Are you able to send php variables to a application in a tab (in
I created an application using bonjour and I am able to send files from
Basically I want to create an application on Android device which able to send
I have a client that wants the application to be able to send SMS
I'm writing an Android application that I want to be able to send requests
For my application, I need to be able to send an std::vector<std::string> over a
We need to make our enterprise ASP.NET/NHibernate browser-based application able to function when connected

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.