Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

That's complicated:

    "Türkiye".ToUpperInvariant()

    "Türkiye".ToUpper()
TÜRKIYE

    "Türkiye".ToUpper([System.Globalization.CultureInfo]::GetCultureInfo("tr-TR"))
TÜRKİYE


I just got this...

    > "Türkiye".capitalize()
    UniquenessError("Ankara is already the capital")


Something's wrong with your implementation. That shouldn't be a uniqueness constraint as a country may have multiple capitals. https://en.wikipedia.org/wiki/List_of_countries_with_multipl...

Also, "Nauru".capitalize() should succeed as it has no official capital.

(tongue firmly in cheek ;)


Can someone help me? Is this an error?

  "Switzerland".capitalize()
  "HELVETICA"


Switzerland has four official languages, with the English word "Switzerland" having a particular translation to each one. But if you choose a single official name in one of those languages, it is not fair to the others, so in addition an official name in each language, they have an official in a 'neutral' language: Latin.

> Due to its linguistic diversity, Switzerland is known by a variety of native names: Schweiz [ˈʃvaɪts] (German);[note 5] Suisse [sɥis(ə)] (French); Svizzera [ˈzvittsera] (Italian); and Svizra [ˈʒviːtsrɐ, ˈʒviːtsʁɐ] (Romansh).[note 6] On coins and stamps, the Latin name, Confoederatio Helvetica – frequently shortened to "Helvetia" – is used instead of the four national languages.

* https://en.wikipedia.org/wiki/Switzerland

That's also why the ccTLD of Switzerland is .ch.

What you're seeing may be an 'artifact' of that.


Yeah lots of people confuse that domain for China.


Odd. I get:

  "Switzerland".capitalize()
  𝔈ℑ𝔇𝔊𝔈𝔑𝔒𝔖𝔖𝔈𝔑𝔖ℭℌ𝔄𝔉𝔗
Maybe my locale is messed up?


It looks like Fraktur to me.

https://en.wikipedia.org/wiki/Fraktur


Got it in one.


Are you in china? That looks like Canton-ese.


It's a thread of jokes. devoutsalsa started with a joke mixing the two meanings of "capital" using a fake example. I joked that "UniquenessError" isn't the right error, as some countries have more than one capital and two countries have no official capital.

One of those two is Switzerland, which has the official Latin name "Confoederatio Helvetica", leading zinekeller joke that the capital form was "HELVETICA". See https://en.wikipedia.org/wiki/Name_of_Switzerland .

I pretended my implementation of that non-extent programming language generated "Eidgenossenschaft", see https://en.wikipedia.org/wiki/Eidgenossenschaft . As that's a German word, I decided to use a blackletter typeface, specifically, the Fraktur in Unicode which is meant to encode mathematical alphanumeric symbols, then imply that my locale the reason I got a German word.


...and Switzerland is divided into cantons :)


I can't tell if you're joking or not! :-o What language/framework is this in?

Edit: I now understand this to be a joke. But.., given the craziness that I've seen in the past, this doesn't seem out of the realm of plausibility!


I think you don't have the right fonts installed.


> That shouldn't be a uniqueness constraint as a country may have multiple capitals

And, in theory, two countries could share the same capital (as a condominium which is equal joint territory of both, or some kind of third territory belonging to neither), although I'm not aware that's ever actually happened. But, at the subnational level, it has happened in India – Chandigarh is the joint capital of two Indian states (Punjab and Chandigarh), each of which has it as its capital despite it being in neither of them, as well as being a union territory (and hence also capital of itself).


Israel and Palestine.


Mine says:

    > "Türkiye".capitalize()
    PrivacyError("That's nobody's business but the Turks'")


Reminds me of the bug in PHP where they used a call to toUpper without specifying locale to enable their case insensitivity and if your locale was Turkey, you couldn’t call any library calls with an i in them if you typed them in lowercase because, e.g., call to phpinfo() would get case-folded into PHPİNFO().


In JavaScript, you can use `String.prototype.toLocaleUpperCase()`

    > 'Türkiye'.toLocaleUpperCase('TR')
    'TÜRKİYE'

[1] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...


In JavaScript:

    "Türkiye".toLocaleUpperCase("tr-TR")
    'TÜRKİYE'




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: