1

I am trying to convert a string into uppercase using a specific character encoding, but it fails.

When I convert istanbul, it converts it into ISTANBUL. However, uppercase "i" is "İ" in Turkish. Is there any solution to this?

Demo: http://jsfiddle.net/fgZZp/

Thanks in advance,

hippietrail
  • 15,848
  • 18
  • 99
  • 158
Merinn
  • 127
  • 1
  • 9
  • See also possible duplicate: **[Turkish case conversion in JavaScript](http://stackoverflow.com/questions/1850232/turkish-case-conversion-in-javascript)** – hippietrail Mar 08 '12 at 00:54

1 Answers1

4

To some degree - the JavaScript String class does have a toLocaleUpperCase method, but the locale used is always the user's locale. You can't arbitrarily choose a locale for it to use.

(Nitpick: What you're asking about is a locale issue, not character encoding. Character encoding only has to do with what bits are used to represent a given character; it doesn't generally affect how operations on those characters should behave.)

  • Thanks really. Though, I will probably use the function in the other link that hippietrail has posted. It needs to be persistent across the browsers. – Merinn Mar 08 '12 at 01:13