Issue #16182: Merge readline locale fix from 3.5