Search code examples
objective-cunicodensstringnsstringencoding

Insert UNICODE HAIRSPACE character into NSString


i'm trying to add a UNICODE character to NSString in this ways:

NSString *euFormatted = [NSString stringWithFormat:@"\u200A%@",self.eu];

or

unichar hairspaceChar = 0x200A; // hairspace symbol
NSString* hairSpace = [[NSString alloc] initWithCharacters:&hairspaceChar length:1];
NSString *euFormatted = [NSString stringWithFormat:@"%@%@",hairSpace,self.eu];

But not results ... i try to find a solution but is making me crazy since 3 days.

I have try also to set the Font of UILabel that show the string like that:

bigFont = [UIFont fontWithName:@"Helvetica" size:10.0f];

but no way, the HAIRSPACE is not supported.

here a screenshot if what i see, the HAIRSPACE suppose to be after the NUMBER 10 and BEFORE the '°' character.

enter image description here


Solution

  • Found solution: Apple supported Characters and row UTF8 Characters

    The HAIRSPACE is too small, i will go for Punctuation Space that is a bit Bigger and visible,