How to use Norwegian language iphone? - iphone

How can i use Norwegian characters to show them in UILabel in my application.
if i use it directly it shows garbage value.

The characters should work. I'm using a UILabel which loads from a nib file into the view of a ViewController. The label works in Times New Roman and Palatino (and presumably other fonts) when I set the text with the following code: [myLabel setText:#"ÆØÅ æøå"]; . I would try copying and pasting that line directly and see what happens.
I would guess that you're getting your characters from somewhere whose representation is not quite right in NSString terms. I grabbed these from Wikipedia. (I don't speak Norwegian so I'm not sure if you need other non-English alphabet characters - as far as I could see these were the only ones.)

Related

Star symbol too small in a dialer-like view

I'm trying to create a dialer-like application:
I'm using [UIFont systemFontOfSize:33]. The problem is that the Asterisk symbol is too small in comparison to the numbers and '#'.
I printed 123*# in all 61 available iOS6 fonts and the star is smaller than other chars in all of them.
Does somebody have an idea how to solve this?
One thing I tried is changing font size only for * button. That works, but when I hit this button it appears small [off course] in the input above...
Hope my Question is clear.
Thanks.
Use a different character for the display. In Xcode, click on the Edit menu and select Special Characters. When the character viewer appears, type "asterisk" into the search field. Try one of the many other related symbols.
Depending on how you do this, you may need to replace the used symbol with a proper asterisk internally to use the result in a tel URL.
You can use attributedString and change the font size to big enough of all asterisks

How can I display super script number in text view iphone sdk?

I want to display super script number in a simple text view can any one help me for that?
UITextView can't handle rich text so if you want to have superscripted numbers you have to build up a string using the unicode characters for superscripted numbers, e.g.
NSString *super0 = #"\u2070";
Gives you a superscripted zero. You can find the rest of the numerals here on wikipedia. You'll have to build up the string yourself from the individual digits but that will be a nice programming exercise.
Under the Edit menu in Xcode there is a Special Characters option.
int no=1;
NSString *str=#"xyz";
*yourtextView*.text=[NSString stringWithFormat:#"%#%d",str,no];

Displaying accents and other UTF-8 characters in a UILabel

I have a little app which lists the names of certain people from around the world, and some of those names use characters that are not normal ASCII characters, like DÌaz, or ThÈrËse for example.
The strings show up in Xcode just fine, but when I put them in a UILabel, they behave unexpectedly.
My question is: Is there a way to set up a UILabel to to take the exact string in Xcode, and display it properly, even if it is a UTF-8 character (or any other character encoding for that matter)?
UIKit fully supports unicode, your problem is most likely the encoding of the source file. You can set that in the inspector (Xcode 4: ⌘⌥1) under "Text Settings". Make sure it is UTF-8 as well.
Alternative: Use unicode escapes like #"\u2605" (should display ★).
Try to encode the String:
NSString *s = [NSString stringWithCString:value encoding:NSASCIIStringEncoding];

displaying and storing Arabic characters

I have an array that stores it's elements from a text file. I want to store Arabic characters inside that file but i have problems:
When I try to write this word in text it display it opposite not correct :
ex. شجرة I want to store that word
when i paste it in text file it converted into backward direction like
tree becomes eert.
I don't know anything about Unicode converting to display it in a label??
can any one help me with storing it in array and display it in label???
Thank you.
The new release of Mac OS X 'Lion' is going to provide support for the arabic language system wide. I assume this will fix the problem of editing Arabic characters in Xcode. There is also a support for Arabic with text-to-voice services, a new Arabic 'speaker' or sound called Majed.

Unicode not converted when displayed

I'm localizing an app to spanish, and characters are encoded in the Localizable.strings file for that language using Unicode. For example, I have the entry: "login.saveSettings"="Guardar configuraci\\u00F3n:"; which is displayed in a UILabel exactly like that ("Guardar configuraci\\u00F3n:"), instead of "Guardar configuración:". I tried different variations, such as "\u00F3", or "\\U00F3", but without any success.
I use NSLocalizedString this way: self.saveSettingsLabel.text = NSLocalizedString(#"login.saveSettings", #"Save Settings:");
What am I doing wrong?
Thanks for any help!
Mihai
The correct variant is \U00F3 with 1 backslash and a capital U.