Ref T13060. Ref T7339. Ref T5554. Although I don't plan to pursue resolving the latter two issues for now, I think we do have enough information to be confident that setlocale() is the ultimate pathway forward.
Add some wrappers with error checks and unit tests for the day that we eventually tackle T7339/T5554, and so we're on better footing if the setlocale() change in T13060 has unintended effects.