Fixed #18404 -- Encoded storage location with filesystem or default encoding

Thanks andkit for the initial patch

- updated patch to work with Python 3: use force_text