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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T11:27:14+00:00 2026-06-11T11:27:14+00:00

I have a form with UItextfield and when entering this characters ( á é

  • 0

I have a form with UItextfield and when entering this characters ( á é í ó ú ü ñ ) and send to a server via POST method, the content of this characters are transformed.

eg.: this word “ñiña” wrote in the Textfield become on output as “√±i√±a”

 NSString *post = [NSString stringWithFormat:@"&email=%@&password=%@&id_user=%@&iso_pais=%@&lugar=%@&titulo=%@&comment=%@&api_key=3333333",emailstring,passstring,idstring,locatedAtisocountry,cityLabel.text,title.text,description.text];

                NSLog(@"%@",post);
                NSData *postData = [post dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES];
                NSString *postLength = [NSString stringWithFormat:@"%d",[postData length]];
                NSMutableURLRequest *request = [[[NSMutableURLRequest alloc] init] autorelease];
                [request setURL:[NSURL URLWithString:[NSString stringWithFormat:@"http://www.myweb.com/api/exp?format=json"]]];
                [request setHTTPMethod:@"POST"];

The output of the post method is :

&email=username&password=5555&id_user=1032&iso_pais=PL&lugar=Madrid&titulo=ñiña&comment=&api_key=3333333

But the server side decodes the content of the key “titulo” as “nina” and should be “ñiña”

How can I fix this issue with this characters ?

  • 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-06-11T11:27:15+00:00Added an answer on June 11, 2026 at 11:27 am

    You should use percent escapes when passing characters thru the GET or POST parameters.

    Use the stringByAddingPercentEscapesUsingEncoding: method for that.

    Also don’t use NSASCIIStringEncoding but rather NSUTF8StringEncoding if your server supports UTF8 (hopefully it does) and don’t allow lossy convertion (that’s the part in your code that transforms “ñ” to “n”)

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

Sidebar

Related Questions

I have form like this: <form method=POST> <p> Nazwa kategorii: <br /> <input name=NazwaKat
I have a method, -(void)validateFormInput:(UITextField *)textField that gets called when the form's submit button
I have Form as <form name=selectdoctype method=post action= id=selectdoctype> <table style=border:none;> <tr><td colspan=2> (<span
I have form: <?php while ($row = mysql_fetch_array($result)) { echo <form action='login.php' method='POST'>; echo
I have form in my html page <form id=login_form method=POST action=index.php> <table> <tr> <td><label
I have form: <form method='post' action='script.php'> <textarea id='main' name='text'></textarea> <input type='hidden' name='id' value='1'> <input
I have form that makes a request via post managed by ajax. However, it
I have form in my page, I am using ajax.beginform(). Inside this form I
i have form with user data to input and javascript ajax to send information
I have form like this: <div class=satu> <input type='text' size='1' maxlength='1' name='score[1][]' id='score[1][]'> </div>

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.