Re: [Flightgear-devel] STL string and lowercase
Jon Berndt wrote: What is locale support? If that means for different character sets (as in different geographic and language areas), it has to work around the world, of course. Is that what "locale" refers to? Localization (L10N) and Internationalization (I18N) are more than just character sets -- different languages and even different regions using the same language have different ideas of what lower- and upper-case characters match, and some languages have no concept of case at all. There are many other issues involved, including sorting. Some languages also mix character sets from different languages -- for example, in Japanese you can see Japanese syllabic characters, Roman characters, and Han Chinese characters all in the same sentence. Unix has some support for localization -- you can set the locale (language/region) using an environment variable and then some functions in the standard library will use that to look up tables for case translation, sorting, etc. I imagine that there's something similar in Windows. I don't claim to be an expert in L10N or I18N, but Google or the Wikipedia can probably bring you to some good programmer's tutorials. All the best, David ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d
RE: [Flightgear-devel] STL string and lowercase
> -Original Message- > From: Jon Berndt > Sent: 24 August 2004 13:39 > To: FlightGear developers discussions > Subject: RE: [Flightgear-devel] STL string and lowercase > > > > With or without locale support? > > What is locale support? If that means for different character > sets (as in different > geographic and language areas), it has to work around the > world, of course. Is that what > "locale" refers to? > > Jon Yes, the "locale" accounts for the different habits of people around the world. Things like the fact that parts of Europe use a , as a decimal point, and . as a thousands separator. The locale settings usually also have information about currency symbol, date and time formet, time offset from GMT etc etc etc. Richard This e-mail has been scanned for Bede Scientific Instruments for all viruses by Star Internet. The service is powered by MessageLabs. For more information on a proactive anti-virus service working around the clock, around the globe, visit: http://www.star.net.uk ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d
RE: [Flightgear-devel] STL string and lowercase
> With or without locale support? What is locale support? If that means for different character sets (as in different geographic and language areas), it has to work around the world, of course. Is that what "locale" refers to? Jon ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d
Re: [Flightgear-devel] STL string and lowercase
Jon Berndt wrote: Does anyone know a good algorithm to take an STL string to lower case? With or without locale support? All the best, David ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d
RE: [Flightgear-devel] STL string and lowercase
> Jon Berndt writes: > > > > Does anyone know a good algorithm to take an STL string to lower case? > > **untested** > Thanks, Norman: I finally got some time to look around. I found this web page, http://www.msoe.edu/eecs/cese/resources/stl/string.htm with this text: "transform: This STL algorithm (from the library) is a little tricky, but simple uses are easy. For example, we can iterate through the characters in a string, modifying them in some way, and returning the modified characters back to their original positions. In this case, we set the result iterator to specify the beginning of the string. A common application is to convert a string to upper or lower case. string str22 = "This IS a MiXed CaSE stRINg"; transform (str22.begin(),str22.end(), str22.begin(), tolower); cout << "[" << str22 << "]" << endl; // the output is: [this is a mixed case string] Note that the result iterator must specify a destination that is large enough to accept all the modified values; here it is not a problem, since we're putting them back in the same positions. The tolower function (along with toupper, isdigit, and other useful stuff) is in the library; for more general case conversions, take a look at the library, which is beyond the scope of the present discussion." ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d
Re: [Flightgear-devel] STL string and lowercase
On Mon, 23 Aug 2004 20:20:25 -0500, Jon wrote in message <[EMAIL PROTECTED]>: > Does anyone know a good algorithm to take an STL string to lower case? ..' tolower '? Looks like a C type thing to me. There's also ' tr ', is possibly ported to Wintendo or useable thru Cygwin or somesuch. -- ..med vennlig hilsen = with Kind Regards from Arnt... ;-) ...with a number of polar bear hunters in his ancestry... Scenarios always come in sets of three: best case, worst case, and just in case. ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d
RE: [Flightgear-devel] STL string and lowercase
Jon Berndt writes: > > Does anyone know a good algorithm to take an STL string to lower case? **untested** char *strlwr (char * a) { char *ret = a; while (*a != '\0') { if (isupper (*a)) *a = tolower (*a); ++a; } return ret; } my_str = strlwr(my_str.c_str()); ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d