ReactOS full UTF-8 support?

Here you can discuss ReactOS related topics.

Moderator: Moderator Team

Post Reply
Quim
Posts: 257
Joined: Wed Jul 04, 2018 11:45 pm

ReactOS full UTF-8 support?

Post by Quim »

Reading from https://github.com/pbatard/rufus/blob/m ... api_utf8.h
/*
* MSAPI_UTF8: Common API calls using UTF-8 strings
* Compensating for what Microsoft should have done a long long time ago.
* Also see http://utf8everywhere.org/
*
*/
Does ReactOS have a better and respectable UTF-8 support than Windows?
middings
Posts: 1073
Joined: Tue May 07, 2013 9:18 pm
Location: California, USA

Re: ReactOS full UTF-8 support?

Post by middings »

Well-tested code that is well-written and conforms to ReactOS coding standards is the sincerest form of feature request.
erkinalp
Posts: 861
Joined: Sat Dec 20, 2008 5:55 pm
Location: Izmir, TR

Re: ReactOS full UTF-8 support?

Post by erkinalp »

This is GPLv3, ReactOS is GPLv2. We cannot distribute them together.
-uses Ubuntu+GNOME 3 GNU/Linux
-likes Free (as in freedom) and Open Source Detergents
-favors open source of Windows 10 under GPL2
middings
Posts: 1073
Joined: Tue May 07, 2013 9:18 pm
Location: California, USA

Re: ReactOS full UTF-8 support?

Post by middings »

When UTF-8 was first promoted in 1993, Microsoft Windows was already almost a decade old. Microsoft Windows XP was released in 2001, two years before UTF-8 was finalized as an international data processing standard. The ReactOS development team aims to support what ReactOS's implementation target (Windows XP) supports. Anything additional will probably have to come from additional code contributors or as a third-party add-on.
Last edited by middings on Fri May 10, 2019 12:58 am, edited 1 time in total.
Quim
Posts: 257
Joined: Wed Jul 04, 2018 11:45 pm

Re: ReactOS full UTF-8 support?

Post by Quim »

Well here there is something useful:
https://github.com/thpatch/win32_utf8
Win32 UTF-8 wrapper

Why a wrapper?
This library evolved from the need of the Touhou Community Reliant Automatic Patcher to hack Unicode functionality for the Win32 API into games using the ANSI functions.

By simply including win32_utf8.h and linking to this library, you automatically have Unicode compatibility in applications using the native Win32 APIs, usually without requiring changes to existing code using char strings.

Extended functionality
In addition, this library also adds new useful functionality to some original Windows functions.

kernel32.dll
CreateDirectoryU() works recursively - the function creates all necessary directories to form the given path.
LoadLibraryExU() can be safely and unconditionally used with the search path flags introduced in KB2533623. If this update is not installed on a user's system, these flags are cleared out automatically.
GetModuleFileNameU() returns the necessary length of a buffer to hold the module file name if NULL is passed for nSize or lpFilename, similar to what GetCurrentDirectory() can do by default.

shell32.dll
SHBrowseForFolderU() always displays an edit box and shows a resizable window if the active thread's COM settings allow it.

shlwapi.dll
PathRemoveFileSpecU() correctly works as intended for paths containing forward slashes

UTF-8 versions of functions that originally only have UTF-16 versions
LPSTR* WINAPI CommandLineToArgvU(LPCWSTR lpCmdLine, int* pNumArgs)

Splits a UTF-16 command-line string (returned by e.g.GetCommandLineW()) into an UTF-8 argv array, and returns the number of arguments (argc) in pNumArgs. The caller has to free the returned array using LocalFree().

HRESULT WINAPI SHParseDisplayNameU(LPCSTR pszName, IBindCtx *pbc, LPITEMIDLIST *ppidl, SFGAOF sfgaoIn, SFGAOF *psfgaoOut)

Converts a path (pszName) to a ITEMLIST pointer (ppidl), required for a number of shell functions. Unlike the original function, this wrapper also works as expected for paths containing forward slashes.


OS compatibility
win32_utf8 it meant to require at least Windows XP - that is, it statically references only Windows functions that were available on XP. Wrappers for functions that were introduced in later Windows versions load their original functions dynamically using GetProcAddress().
[...]

https://github.com/thpatch/win32_utf8
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot] and 42 guests