The right way to do this is to use the hints:
Hashtable hints = new Hashtable(); hints.put(EncodeHintType.CHARACTER_SET, "UTF-8");
Then call this version of encode in the QRCodeWriter class:
encode(String contents, BarcodeFormat format, int width, int height,Hashtable hints)
source share