Commit Graph

203 Commits

Author SHA1 Message Date
Alexandre Julliard 02a04ba05e make_unicode: Store the C2_* values directly in the kernel32 wctype table.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-22 19:16:05 +02:00
Alexandre Julliard f09dade9cb make_unicode: Add a wctype table in kernel32 for GetStringTypeW().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-22 19:16:05 +02:00
Piotr Caban f09f686538 Revert "kernel32: Restore C locale for LC_CTYPE category.".
This reverts commit c8e195e179.

There's still lots of code that works incorrectly in tr_TR.UTF-8 locale
but I think it's good to revert this patch before next release.

Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-03-27 22:01:39 +01:00
Piotr Caban 2eb1849100 kernel32: Don't use strcasecmp.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-03-27 22:01:31 +01:00
Piotr Caban c8e195e179 kernel32: Restore C locale for LC_CTYPE category.
In tr_TR.UTF-8 locale tolower('I') != 'i' (this is not a bug in glibc,
tolower('I') is suppossed to return dotless i that is 2-byte long).
Because of that strcasemp("i", "I") returns that the strings are
different.

Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-03-18 21:43:00 +01:00
Jacek Caban 5bb4212397 kernel32: Support MUI_LANGUAGE_ID flag in EnumUILanguages.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-02-13 19:45:24 +01:00
Huw Davies 2d2e935190 kernel32: Implement canonical composing.
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-02-11 11:52:00 +01:00
Huw Davies dc919db2bf kernel32: Implement canonical reordering.
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-02-11 11:52:00 +01:00
Huw Davies e4a9e2ff2e kernel32: Initial support for canonical decomposition in NormalizeString().
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-02-11 11:52:00 +01:00
Zhiyi Zhang 3ebd2f0be3 kernel32: Implement FindStringOrdinal.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46035
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-10-30 10:53:50 +01:00
Akihiro Sagawa b02cdd3615 kernel32: Fix LCMapString buffer calculation with LCMAP_KATAKANA and LCMAP_HALFWIDTH.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45982
Signed-off-by: Akihiro Sagawa <sagawa.aki@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-10-15 20:13:51 +02:00
Michael Stefaniuc fe70e0e58f kernel32: Use the ARRAY_SIZE() macro.
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-08-14 10:15:59 +02:00
Akihiro Sagawa a5da525229 kernel32: Fix LCMapString(LCMAP_HALFWIDTH) in some cases.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45439
Signed-off-by: Akihiro Sagawa <sagawa.aki@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-07-12 17:01:45 +02:00
Matej Špindler da5112c743 kernel32: Check for LOCALE_NOUSEROVERRIDE for neutral locales.
Signed-off-by: Matej Špindler <spindler.matej@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-05-22 21:58:02 +02:00
Louis Lenders e0f9ff9eb0 kernel32: Improve stub for SetThreadUILanguage.
Signed-off-by: Louis Lenders <xerox.xerox2000x@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-04-02 20:47:11 +02:00
Jarkko Korpi dc5b22963b kernel32: Silence repeated LocaleNameToLCID unsupported flags.
Signed-off-by: Louis Lenders <xerox.xerox2000x@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-03-21 10:14:44 +01:00
Sergio Gómez Del Real 2d74a4ff43 kernel32: Implement FindNLSStringEx.
Signed-off-by: Sergio Gómez Del Real <sdelreal@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-03-13 20:58:07 +01:00
Alexandre Julliard c63a08586f kernel32: Don't return a parent locale for neutral locales in GetLocaleInfoEx.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-11-28 20:32:52 +01:00
Alexandre Julliard c5a39bd98f kernel32: Keep the sublanguage specified by the script name when looking for the default.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-11-13 19:43:13 +01:00
Alexandre Julliard de7e687801 kernel32: Also match script name when looking for a locale.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-11-13 19:04:04 +01:00
Jactry Zeng b9a9fe4a04 kernel32: Add stub for ResolveLocaleName.
Signed-off-by: Jactry Zeng <jzeng@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-07-19 19:13:30 +02:00
Aric Stewart 9dc5d299f1 kernel32: Improve locale detection on Android.
setlocale is coded to just return 'C' for all inquiries ignoring locale
that may be set in the environment.

Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-04-03 17:59:09 +02:00
Alex Henrie 0b95ebd283 kernel32: Check for invalid flags in codepage conversion functions.
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-03-28 10:31:46 +02:00
Andrew Eikum 72b9acd94b kernel32: Don't care about case when finding matching locale.
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-01-25 20:04:51 +01:00
Andrew Eikum 7737693693 kernel32: Use different default sublangs for Spanish and Chinese.
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-01-25 20:04:49 +01:00
Jacek Caban 26d0105cd8 kernel32: Improved GetUserPreferredUILanguages stub.
Implementation and tests are based on GetSystemPreferredUILanguages.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-10-19 08:16:54 -07:00
Akihiro Sagawa 429ca40fc8 kernel32: Implement LCMAP_HALFWIDTH.
Signed-off-by: Akihiro Sagawa <sagawa.aki@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-10-03 11:59:57 +02:00
Akihiro Sagawa 85cff1717d kernel32: Implement LCMAP_FULLWIDTH.
Signed-off-by: Akihiro Sagawa <sagawa.aki@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-10-03 11:59:41 +02:00
Akihiro Sagawa 12c547919f kernel32: Implement LCMAP_KATAKANA.
Signed-off-by: Akihiro Sagawa <sagawa.aki@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-09-23 21:02:58 +09:00
Akihiro Sagawa c4af608845 kernel32: Implement LCMAP_HIRAGANA.
Signed-off-by: Akihiro Sagawa <sagawa.aki@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-09-23 21:02:53 +09:00
Akihiro Sagawa 659e161d7e kernel32: Refactor the codepath and a variable usage.
Signed-off-by: Akihiro Sagawa <sagawa.aki@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-09-23 20:56:53 +09:00
Akihiro Sagawa 5d907050e2 kernel32: Short circuit required length calculation.
Signed-off-by: Akihiro Sagawa <sagawa.aki@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-09-23 20:52:34 +09:00
Akihiro Sagawa 5fbdd644d6 kernel32: Zero is an invalid flag value.
Signed-off-by: Akihiro Sagawa <sagawa.aki@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-09-23 20:50:38 +09:00
Akihiro Sagawa 70a6546753 kernel32: Do not allow to combine NORM_IGNORENONSPACE and/or NORM_IGNORESYMBOLS with other LCMAP flags.
Signed-off-by: Akihiro Sagawa <sagawa.aki@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-09-23 20:50:21 +09:00
Jacek Caban 505406fc83 kernel32: Fixed handling LOCALE_NAME_USER_DEFAULT in GetLocaleInfoEx.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-08-27 13:23:33 +09:00
Francois Gouget c8d1fbc6d2 kernel32: Fix typos in a couple of comments.
Signed-off-by: Francois Gouget <fgouget@free.fr>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-07-04 11:01:42 +09:00
Ken Thomases d90f29d817 kernel32: Overhaul the locale determination on the Mac.
The C library locale is inadequate for conveying the Mac user settings between
LOCALE_Init() and setup_unix_locales().  The set of locales supported by the C
library can't express the combinations allowed in user settings.

Setting LANG to a user-settings-derived locale when there's no corresponding C
library locale is actually worse than leaving it unset.  It will prevent the
C library from honoring the LC_* variables (other than LC_ALL).  That's why
Terminal.app won't set LANG in that case, it just sets LC_CTYPE=UTF-8.  This
commit makes Wine follow similar logic in not setting LANG if the C library
doesn't support the Mac user settings.

Rather, it uses a wrapper around setlocale() to query the locale.  That wrapper
returns a value representing the Mac user settings if the C library comes up
empty.  It also has logic to handle Terminal's setting LC_CTYPE=UTF-8, since
parse_locale_name() can't handle that properly.

Signed-off-by: Ken Thomases <ken@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-06-17 00:09:19 +09:00
Alexandre Julliard 73d9e2ebff kernel32: Use RtlCompareUnicodeStrings in CompareStringOrdinal for consistent results.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-06-14 17:09:54 +09:00
Piotr Caban 4fdfa29e60 kernel32: Use utf8 for filenames encoding if different encoding was not specified on Mac.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Ken Thomases <ken@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-06-01 00:21:47 +09:00
Nikolay Sivov 632266e5b5 kernel32: Set C3_KASHIDA only for kashida character.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-05-16 15:28:55 +09:00
Nikolay Sivov 73f7bf57cb kernel32: Handle NULL locale name in IsValidLocaleName().
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-05-16 15:28:42 +09:00
Hans Leidekker c90845cf93 kernel32: Improve the stub for GetThreadPreferredUILanguages.
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-04-29 20:30:57 +09:00
Louis Lenders a6e1adb8b7 kernel32: Print a FIXME only once in LCMapStringEx.
Signed-off-by: Louis Lenders <xerox.xerox2000x@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-04-26 23:30:16 +09:00
Alexandre Julliard 0bbeaae678 make_unicode: Mark most data tables as hidden.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-02-25 00:25:01 +09:00
Stefan Leichter 9cd67d2a5e kernel32: Return a dummy value in GetSystemPreferredUILanguages.
Signed-off-by: Stefan Leichter <Stefan.Leichter@camLine.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-02-15 21:30:05 +09:00
Alex Henrie 6e841fdb75 kernel32: Set error if dstlen < 0 in codepage conversion functions.
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-01-25 18:49:49 +09:00
Stefan Leichter 1c3c9f06c5 kernel32: Add stub for GetSystemPreferredUILanguages.
Signed-off-by: Stefan Leichter <Stefan.Leichter@camLine.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-01-19 23:00:51 +09:00
Austin English 5d186034c1 kernel32: Make CompareStringEx semi-stub flag FIXME only show once.
Signed-off-by: Austin English <austinenglish@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2015-12-24 12:04:05 +01:00
Jacek Caban 6a7363b694 kernel32: Call registry functions with full key path.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2015-11-19 23:56:39 +09:00
Nikolay Sivov 982c3ede72 kernel32: GetLocaleInfoA() doesn't support LOCALE_SSHORTTIME.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2015-11-11 00:07:43 +09:00
Daniel Lehman 5bf1423c2c kernel32: Return LOCALE_INVARIANT from ConvertDefaultLocale. 2015-08-25 17:41:35 +09:00
Jacek Caban 09176c3aa0 kernel32: Treat empty locale name as LOCALE_INVARIANT. 2015-06-10 15:00:15 +09:00
Christian Faure 9cffed782f kernel32: Fix a crash in GetStringTypeW() on NULL input string. 2015-05-18 14:07:48 +09:00
Mark Harmstone e468f15d20 kernel32: Add GetFileMUIInfo stub. 2015-05-12 15:30:47 +09:00
Mark Harmstone ed0c6746dd kernel32: Stub out GetFileMUIPath. 2015-04-06 12:49:03 +09:00
Sebastian Lackner 51c21cca98 kernel32: Fix calculation of returned buffer in get_registry_locale_info.
Fixes a regression introduced by 8826ba1bc8.
2015-04-06 12:06:18 +09:00
Frédéric Delanoy f6a341c747 Assorted spelling/grammar fixes. 2015-03-27 22:29:48 +09:00
Alex Henrie 6bcf9e4bd8 kernel32: Support UTF-7 in MultiByteToWideChar.
Portions of utf7_mbstowcs were written by Sebastian Lackner.
2015-02-09 20:41:42 +09:00
Alex Henrie 054fa77de0 kernel32: Support UTF-7 in WideCharToMultiByte.
Portions of utf7_wcstombs were written by Sebastian Lackner.
2015-02-09 20:37:27 +09:00
Sebastian Lackner 8826ba1bc8 kernel32: Return proper char count in get_registry_locale_info. 2014-12-16 13:32:53 +01:00
Austin English 76dc45aa1a kernel32: Add a stub for GetUserPreferredUILanguages. 2014-12-10 19:32:28 +01:00
Amine Khaldi 810ed5c85a kernel32: Remove some unused variables (Clang). 2014-10-23 12:14:10 +09:00
Frédéric Delanoy 1e214eb5d3 Assorted spelling/grammar fixes. 2014-10-02 16:58:53 +02:00
Nikolay Sivov ed9e030456 kernel32: Properly implement EnumSystemGeoID(). 2014-07-15 15:29:39 +02:00
Nikolay Sivov 17777c8497 kernel32: Implement GEO_PARENT for GetGeoInfo(). 2014-07-15 15:29:03 +02:00
Nikolay Sivov b4acc62e63 kernel32: Partially implement GetGeoInfo(). 2014-07-11 12:22:26 +02:00
Nikolay Sivov 3a2db918d9 kernel32: Added support for C3_HIGHSURROGATE/C3_LOWSURROGATE in GetStringTypeW(). 2014-06-30 22:04:52 +02:00
Piotr Caban 4eaa85ad56 kernel32: Fix typo in enum_locale_ex_proc. 2014-06-25 14:42:29 +02:00
Erich E. Hoover 32da6626f5 kernel32: Allow CompareStringEx LINGUISTIC_IGNORECASE flag. 2014-04-17 10:48:07 +02:00
Erich E. Hoover b0935ab811 kernel32: Allow CompareStringEx NORM_LINGUISTIC_CASING flag. 2014-04-17 10:48:04 +02:00
Vincent Povirk 49f3b4282d kernel32: Cache locale info from the registry. 2014-03-06 17:18:51 +01:00
Daniel Lehman 37dad12971 kernel32: Use ANSI code page if current thread locale has no code page. 2013-11-08 16:29:43 +01:00
Tatyana Fokina aaed0e81d5 kernel32: Check the size of the string in CompareStringA. 2013-06-11 19:31:45 +02:00
Qian Hong 32e5314250 kernel32: Fixed string comparision for non-canonical locale identifiers such as zh_CN VS zh-Hans on OS X. 2013-04-30 11:49:06 +02:00
Piotr Caban 46919f2154 kernel32: Fixed copy-paste error in IdnToUnicode. 2013-03-28 18:54:51 +01:00
Christian Costa ba5cade700 kernel32: Implement CompareStringOrdinal. 2012-11-02 19:47:15 +01:00
Nikolay Sivov 2097c5ddb6 kernel32: Handle neutral locale names better in GetLocaleInfoEx. 2012-08-27 19:42:52 +02:00
André Hentschel 20e1b46d83 kernel32: Fix LocaleNameToLCID on mismatch. 2012-08-17 10:46:27 +02:00
Austin English 5dfc2a34ea kernel32: Implement IsValidLocaleName (with tests). 2012-08-16 17:26:45 +02:00
Michael Stefaniuc 97512d70cf kernel32: Avoid TRUE:FALSE conditional expressions. 2012-07-31 12:36:54 +02:00
Nikolay Sivov 9ba0cf76db kernel32: Fix base for value returned with LOCALE_RETURN_NUMBER. 2012-07-26 13:40:43 +02:00
Nikolay Sivov 77ad893a7b kernel32: Forward GetLocaleInfoEx() to GetLocaleInfoW(). 2012-07-23 12:50:56 +02:00
Nikolay Sivov b586be515c kernel32: Added GetSystemDefaultLocaleName(). 2012-07-23 12:50:26 +02:00
Nikolay Sivov 0e234f3c25 kernel32: Partial CompareStringEx implementation. 2012-07-20 14:01:45 +02:00
Austin English b22de982c0 kernel32: Add a stub for GetLocaleInfoEx. 2012-07-10 10:43:06 -05:00
André Hentschel 3cd0834a24 kernel32: Change LCMapStringW to LCMapStringEx and call it from LCMapStringW. 2012-06-28 11:36:56 +02:00
Alex Henrie 8ccf747d6a kernel32: Correct WideCharToMultiByte and MultiByteToWideChar error codes and conditions. 2012-05-17 17:44:26 +02:00
Alex Henrie 92b4979b33 kernel32: Avoid calling MultiByteToWideChar with invalid parameters. 2012-05-17 17:44:26 +02:00
Piotr Caban e2f0463963 kernel32: Added IdnToUnicode implementation. 2012-04-30 20:03:26 +02:00
Piotr Caban 03b58f580c kernel32/tests: Added IdnToAscii tests. 2012-04-30 20:03:26 +02:00
Piotr Caban 04ad71ee05 kernel32: Added IdnToAscii implementation. 2012-04-30 20:03:25 +02:00
Piotr Caban 60b25b7dd6 kernel32: Support multiple labels in IdnToNameprepUnicode. 2012-04-30 20:03:25 +02:00
Piotr Caban a08710f3d0 kernel32: Added IdnToNameprepUnicode implementation. 2012-04-26 19:47:57 +02:00
André Hentschel 21b6d994d2 kernel32: Handle LOCALE_NAME_USER_DEFAULT with tests. 2012-03-27 11:55:05 +02:00
Andrew Talbot d1136d4aca kernel32: Remove unused file-static variables. 2011-11-16 09:44:48 +01:00
Frédéric Delanoy b5a33dab88 dlls: Assorted spelling fixes. 2011-08-02 20:47:51 +02:00
Frédéric Delanoy 6471e862f6 kernel32: Fix function description of CompareStringA and lstrcmpA. 2011-07-20 19:42:10 +02:00
Thomas Mullaly 1c7d32aa25 kernel32: Added stubs for IDN functions. 2011-01-04 11:49:45 +01:00
Alexandre Julliard 9f792ab3d5 kernel32: Implemented EnumSystemLocalesEx. 2010-09-27 14:13:17 +02:00
Rudolf Mayerhofer 2637bb9de7 kernel32: Implement GetUserDefaultLocaleName using users default LCID. 2010-09-15 11:28:53 -05:00