locale

After updating AppCompat library to appcompat:1.1.0-alpha03 Locale configuration is not working anymore

眉间皱痕 提交于 2019-12-10 17:14:13
问题 After updating implementation 'androidx.appcompat:appcompat:1.1.0-alpha02' to implementation 'androidx.appcompat:appcompat:1.1.0-alpha03' locale settings was not working anymore, spent half day to figure out that library was the actual problem. Is there another NEW way for locale setting or workaround, or is it just a bug in the library and should just wait for another version with bugfix? 来源: https://stackoverflow.com/questions/55355775/after-updating-appcompat-library-to-appcompat1-1-0

Locale-aware Perl regular expressions (matching word boundaries)

眉间皱痕 提交于 2019-12-10 16:49:01
问题 I'm currently somewhat stuck getting a regular expression in Perl (taken from an earlier question of mine) to match word characters from a non-ASCII locale (i.e., German umlauts). I already tried various things such as setting the correct locale (using setlocale), converting data that I receive from MySQL to UTF8 (using decode_utf8), and so on... Unfortunately, to no avail. Google also did not help much. Is there any chance to get the following regex locale-aware so that $street = "Täststraße

IOException message not printed correctly when using Java 9 on Windows 10 set to Japan locale and language

。_饼干妹妹 提交于 2019-12-10 16:28:25
问题 An Exception is thrown in this particular block. try { transport.m_readListener.onReadTransport(transport); } catch (IOException e) { ->onIOException(e,transport); } The onIOException() method puts it on the log: private void onIOException(IOException e, AbstractConnection connection) { String reason = e.getMessage(); ... log.error("Closing ",connection," because ",reason); } The reason variable in Java 8 shows a correct japanese phrase: reason : 既存の接続はリモート ホストに強制的に切断されました 。 (meaning: The

Is cout Guaranteed to Have the ctype<char> facet?

﹥>﹥吖頭↗ 提交于 2019-12-10 16:20:06
问题 Given: auto foo = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"s I can convert all the characters to lowercase by: use_facet<ctype<char>>(cout.getloc()).tolower(data(foo), next(data(foo), foo.size())); Live Example But this depends upon cout.getloc() containing the ctype<char> facet . Presuming that I'm using an unmodified cout can I assume that cout.getloc() will contain the facet ctype<char> or do I need to confirm this before use with: has_facet<ctype<char>>(cout.getloc()) 回答1: From cppreference: Each

getISOCountries() method displays only two letters of contry name. Is Get full name of country using this method possible?

徘徊边缘 提交于 2019-12-10 16:19:20
问题 I used following code, but it displays only 2 digit of ISO country name. For example, for "INDIA", it only display "IN". Can I show full name as "INDIA" ? String[] loc= Locale.getISOCountries(); for(int a=0;a<loc.length;a++) { System.out.println("ISO Contry "+a+":"+loc[a]); } I want full name of ISO country. Is it possible to get using this method? 回答1: Try using getDisplayCountry() method. Example: import java.util.Locale; public class Main { public static void main(String [] argv) { Locale

How to read utf-16 file into utf-8 std::string line by line

◇◆丶佛笑我妖孽 提交于 2019-12-10 15:42:07
问题 I'm working with code that expects utf8-encoded std::string variables. I want to be able to handle a user-supplied file that potentially has utf-16 encoding (I don't know the encoding at design time, but eventually want to be able to deal with utf8/16/32), read it line-by-line, and forward each line to the rest of the code as a utf8-encoded std::string. I have c++11 (really, the current MSVC subset of c++11) and boost 1.55.0 to work with. I'll need the code to work on both Linux and Windows

How to get the user's current city name without using the core location service?

▼魔方 西西 提交于 2019-12-10 15:29:31
问题 So the original requirements was that on the launch of the app, the mobile app will get the current location of the user precise to City. Based on the city, the server/app client will give-city related content. I know it would not be too difficult if I could use the core location service (since you know suspicious (self-concerned) users usually will disable the location service for a not-so-trusting app). I have searched the web for few hours and get an summary of following solutions where I

Specifying locale for http request/response

牧云@^-^@ 提交于 2019-12-10 15:29:10
问题 I have a ReSTful web service which needs to parse locale-sensitive data from the request. This data could either be in an XML body or part of the query string. Is there any acepted way of determining which locale the data is being sent in (and by extension the locale in which the response should be sent)? One option is simply to specify to the clients the locale in which all requests should be sent. A friendlier option seems to be to allow the client to specify the locale. I've considered: a)

Locale-invariant string processing with strtod strtof atof printf?

喜欢而已 提交于 2019-12-10 15:25:32
问题 Are there any plans for adding versions of C standard library string processing functions that are invariant under current locale? Currently there are lots of fragile workarounds, for example, from jansson/strconv.c: static void to_locale(strbuffer_t *strbuffer) { const char *point; char *pos; point = localeconv()->decimal_point; if(*point == '.') { /* No conversion needed */ return; } pos = strchr(strbuffer->value, '.'); if(pos) *pos = *point; } static void from_locale(char *buffer) { const

Thread safe locale techniques

主宰稳场 提交于 2019-12-10 15:14:37
问题 We're currently writing a web application based on a threaded python web server framework (cherrypy) and would like to simultaneously support users from multiple locales. The locale module doesn't appear to be thread safe. Are there 3rd party libraries or modules that provide locale parsing and formatting functionality in a thread-safe way? Suggestions appreciated! Regards, Malcolm 回答1: pyIcu has some such functionality (and other great support for i18n/l10n tasks), and I've been using it