Search code examples
uppercaselowercasenon-latin

In Python (or any language) what does an "upper" function do to Hindi, Amharric and other non-Latin character sets?


Subject says it all. Been looking for an answer, but cannot seem to find it.

I am writing a web app that will store data in a database and also have language files translated into a wide variety of character sets. At various moments, the text will be presented. I want to control presentation such as spurious blank spaces at the beginning and end of strings. Also I want to ensure some letters are upper or lower case.

My question is: what happens in upper/lower case functions when the character set only has one case?

EDIT Sub question: Are there any unexpected side effects to be aware of?

My guess is that you simply get back the one and only character.

EDIT - Added Description The main reason for asking this question is that I am writing a webapp that will be distributed and run on machines in remote areas with little or no chance to fix "on-the-spot" bugs. It's not a complicated webapp, but will run with many different language char sets. I want to be certain of my footing before releasing the server.


Solution

  • First of all the upper() and lower() method in python can be applied to Hindi, Amharric and non-letter character sets.

    For instance will the upper() method converts the lowercase characters if an equivalent uppercase of this char exists. If not, then not.

    Or better said, if there is nothing to convert, it stays the same.