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

  • Home
  • SEARCH
  • 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 94829
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T23:33:46+00:00 2026-05-10T23:33:46+00:00

It seems UITextFields convert all non-breaking spaces (nbsp, U+00A0) to spaces (U+0020). This causes

  • 0

It seems UITextFields convert all non-breaking spaces (nbsp, U+00A0) to spaces (U+0020). This causes problems for the editing of locale specific numbers. For instance, in the French/France locale, the non-breaking space separates 1 and % to form ‘1 %’. However, since the UITextField converts the separator character to a space, the locale aware NSNumberFormatter is unable to parse the locale string and convert it to a number.

The following code snippet illustrates this problem.

NSLocale *fr_FR = [[[NSLocale alloc] initWithLocaleIdentifier:@'fr_FR'] autorelease];  NSNumberFormatter *percentageFormatter = [[NSNumberFormatter alloc] init]; [percentageFormatter setFormatterBehavior:NSNumberFormatterBehavior10_4]; [percentageFormatter setGeneratesDecimalNumbers:TRUE]; [percentageFormatter setNumberStyle:NSNumberFormatterPercentStyle]; [percentageFormatter setLocale:fr_FR];  NSDecimalNumber *one = [NSDecimalNumber decimalNumberWithString:@'0.01'];  // will be '1 %' where the separator character is a nbsp (this is correct) NSString *percentage = [percentageFormatter stringFromNumber:one];  UITextField *textField = [[UITextField alloc] init]; textField.text = percentage;  // will be '1 %' where the separator character is a space (this is wrong) NSString *textFieldValue = textField2.text;  // returns an indeterminate value: may throw an exception, may return nil, etc // this should return the number 0.01 NSNumber *percentageNumber = [percentageFormatter numberFromString:textFieldValue]; 

My question: How do I prevent the UITextField from converting non-breaking spaces to spaces?

I understand the work arounds I can employ to hack this so that it works if I’m in a locale that uses non-breaking spaces. However, if there is property/behavior of the UITextField that I’m not aware of to preserve nbsp, I’d like to know.

  • 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. 2026-05-10T23:33:47+00:00Added an answer on May 10, 2026 at 11:33 pm

    I’m pretty sure this feature doesn’t exist. How about opening a bug report for the iPhone?

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

Sidebar

Ask A Question

Stats

  • Questions 65k
  • Answers 65k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer You'd need to chmod it, and you can probably do… May 11, 2026 at 11:11 am
  • added an answer You can initiate a call https://developer.apple.com/library/archive/featuredarticles/iPhoneURLScheme_Reference/PhoneLinks/PhoneLinks.html So this would probably… May 11, 2026 at 11:11 am
  • added an answer This problem was solved by adding new components by using… May 11, 2026 at 11:11 am

Related Questions

It seems UITextFields convert all non-breaking spaces (nbsp, U+00A0) to spaces (U+0020). This causes
It seems to me obfuscation is an idea that falls somewhere in the security
It seems that a List object cannot be stored in a List variable in
It seems that it is impossible to capture the keyboard event normally used for
It seems like the only way to do this is to pass the -i
It seems like there should be something shorter than this: private string LoadFromFile(string path)
It seems like such a simple thing, but I can't find any obvious solutions...
It seems to me that it would work perfectly well to do tail-recursion optimization
It seems like the generation of SQL scripts from the SQL Server Management Studio
It seems to be the general opinion that tables should not be used for

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.