Skip to content

F2592 locale date time#37

Open
shewitt-au wants to merge 44 commits intoWerWolv:masterfrom
shewitt-au:F2592-Locale-date-time
Open

F2592 locale date time#37
shewitt-au wants to merge 44 commits intoWerWolv:masterfrom
shewitt-au:F2592-Locale-date-time

Conversation

@shewitt-au
Copy link
Contributor

@shewitt-au shewitt-au commented Mar 9, 2026

Problem description

In ImHex Dates and times currently have a fixed format and do not respect the selected language. MinGW’s (Windows) std::locale class is broken and basically useless. This PR implements, along with the ImHex PR linked below, date and time formatting using the Win32 API on Windows and the C runtime library on other OSes.

The motivating feature request can be found here:
Format time based on locale #2592

The corresponding ImHex changes can be found here:
ImHex changes

Implementation description

Three new files have been added:

  1. "soo_buffer.hpp" in utiils. A buffer for POD types that keeps small allocations on the stack and transparently moves to heap storage when the size exceeds a configurable limit. During reallocation, the contents of the previous buffer may optionally be copied to the new one.
  2. "date_time_format.hpp". A header file for new date and time formatting functions.
  3. "date_time_format.cpp". The implementation of the new formatting function. On Windows some functions are also exposed that are used by the Windows version of the main formatting function.

@shewitt-au shewitt-au marked this pull request as ready for review March 11, 2026 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant