sw: avoid calling convertToString() with unsupported encodings

Change-Id: If0b589c884cd306ca7c94d3366af66276a120176
(cherry picked from commit b51d9c633c2b5d03478be7b175fdbea367376c72)
Reviewed-on: https://gerrit.libreoffice.org/9936
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>