support for both py2 and py3 in strftime locale decoding