There's already one for OUString; copy that one and adjust for
OString and single-byte characters.
Change-Id: I2de901ead05284f9a73eadecf8628f30f8521b55
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208865
Tested-by: Jenkins
Reviewed-by: Dan Williams <dcbw@libreoffice.org>