• Harald Sitter's avatar
    use qbytearray instead of manual memory management · 9b1001b5
    Harald Sitter authored
    there's no real point to storing the original locale as cstring instead
    of in a QBA. it does have the downside that we need to manually free the
    string though. also QBA condenses the copy logic (it also was
    way too verbose to begin with).
    
    also this is more correct behavior... in the event that the setlocale
    query returned nullptr (the request could not be honored) we'll want to
    reset to a sane "default". the way to achieve that is by setting an
    empty string, and that is precisely the behavior QBA will exhibit as
    it's always at least {\0} even when constructed from a nullptr. i.e.
    instead of calling `setlocale(..., nullptr)` (which is a query and
    pointless) we would now call `setlocale(..., "")` which resets the
    category from the process environment.
    naturally when we actually got a string back we'll rest to that
    9b1001b5