Does Javascript string.toLowerCase() follow Unicode standards in case-conversions?

Viewed 7434

I'm creating a browser-based form verification script that checks if the input doesn't have any uppercase characters according to Unicode Standards. My definition of an uppercase character is a character that has a lowercase mapping. If a certain character in the input string doesn't have a lowercase or uppercase mapping (like chinese characters) then it's alright (it should pass my validation).

I'm using UTF-8 encoding.

I'm planning to create a function that looks like this:

function hasUpper(str){
  if(str != str.toLowerCase()){
    return true
  }
  else {
    return false
  }
}

Will this work for my needs?

Thanks!

2 Answers
Related