Locale Question



1
2
3
4
5
6
7
8
9
10
11
12
13
 #include <locale>
std::string toUpper(const std::string& s)
{
    std::string result;

    std::locale loc;
    for (unsigned int i = 0; i < s.length(); ++i)
    {
        result += std::toupper(s.at(i), loc);
    }
    
    return result;
}


What does the locale do in this function? I did read up about it and it said it was culture specific and makes it more "portable" but I don't understand why it was used in this example completely. If someone could let me know why it was used it would be great, thanks.
Topic archived. No new replies allowed.