OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 size_t dash_position = locale.Find('-'); | 50 size_t dash_position = locale.Find('-'); |
51 if (dash_position == kNotFound) | 51 if (dash_position == kNotFound) |
52 return locale; | 52 return locale; |
53 return locale.Left(dash_position); | 53 return locale.Left(dash_position); |
54 } | 54 } |
55 | 55 |
56 static LCID LCIDFromLocaleInternal(LCID user_default_lcid, | 56 static LCID LCIDFromLocaleInternal(LCID user_default_lcid, |
57 const String& user_default_language_code, | 57 const String& user_default_language_code, |
58 const String& locale) { | 58 const String& locale) { |
59 String locale_language_code = ExtractLanguageCode(locale); | 59 String locale_language_code = ExtractLanguageCode(locale); |
60 if (EqualIgnoringCase(locale_language_code, user_default_language_code)) | 60 if (DeprecatedEqualIgnoringCase(locale_language_code, |
| 61 user_default_language_code)) |
61 return user_default_lcid; | 62 return user_default_lcid; |
62 if (locale.length() >= LOCALE_NAME_MAX_LENGTH) | 63 if (locale.length() >= LOCALE_NAME_MAX_LENGTH) |
63 return 0; | 64 return 0; |
64 UChar buffer[LOCALE_NAME_MAX_LENGTH]; | 65 UChar buffer[LOCALE_NAME_MAX_LENGTH]; |
65 if (locale.Is8Bit()) | 66 if (locale.Is8Bit()) |
66 StringImpl::CopyChars(buffer, locale.Characters8(), locale.length()); | 67 StringImpl::CopyChars(buffer, locale.Characters8(), locale.length()); |
67 else | 68 else |
68 StringImpl::CopyChars(buffer, locale.Characters16(), locale.length()); | 69 StringImpl::CopyChars(buffer, locale.Characters16(), locale.length()); |
69 buffer[locale.length()] = '\0'; | 70 buffer[locale.length()] = '\0'; |
70 return ::LocaleNameToLCID(buffer, 0); | 71 return ::LocaleNameToLCID(buffer, 0); |
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
490 case kNegativeFormatSignPrefix: // Fall through. | 491 case kNegativeFormatSignPrefix: // Fall through. |
491 default: | 492 default: |
492 negative_prefix = negative_sign; | 493 negative_prefix = negative_sign; |
493 break; | 494 break; |
494 } | 495 } |
495 did_initialize_number_data_ = true; | 496 did_initialize_number_data_ = true; |
496 SetLocaleData(symbols, g_empty_string, g_empty_string, negative_prefix, | 497 SetLocaleData(symbols, g_empty_string, g_empty_string, negative_prefix, |
497 negative_suffix); | 498 negative_suffix); |
498 } | 499 } |
499 } | 500 } |
OLD | NEW |