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 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 58k
  • Answers 58k
  • 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 If it's not the Home edition of XP, you can… May 11, 2026 at 8:40 am
  • added an answer Some random thoughts: Have you tried controlling the text length… May 11, 2026 at 8:40 am
  • added an answer Yes, the callback is guaranteed to be called. The callback… May 11, 2026 at 8:40 am

Top Members

Trending Tags

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

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.