Empty spaces in QRCode source string

Aug 7, 2013 at 12:45 PM
Edited Aug 8, 2013 at 4:40 AM
Hello everybody.

I have a task of generating the Qr Code from string which can have blocks of a few space symbols.
(Fox exampe: "aaaa aa ;bbb b ;cd efg ;")
Here is the code that generates the image:
Map<EncodeHintType, Object> hints = new HashMap<EncodeHintType, Object>();
        hints.put(EncodeHintType.CHARACTER_SET, "windows-1251");
        try {
            return MatrixToImageWriter.toBufferedImage(
                    new QRCodeWriter().encode(text, BarcodeFormat.QR_CODE, 400, 400, hints));
        } catch (WriterException e) {
            return null;
The problem is: when the application runs on MS Windows(debug mode in Intelilj IDEA IDE), the image is generated correctly - after parsing it I receive the same text ("aaaa aa ;bbb b ;cd efg ;").
But when I'm trying to run in ( as web application deployed on apache tomcat 6 ) on production server (freeBSD) after parsing the image I receive the string without empty blocks:
"aaaa aa;bbb b;cd efg;"
But I need this empty blocks.

Looks like there is some kind of default settings whitch depends on environment.

Can anybody please help me in receiving correct QR Code with that empty blocks of text decoded?

Thanks a lot!
Aug 8, 2013 at 4:09 PM
I think your message isn't in the right forum. This is the discussion forum for the .Net port of zxing.
Please post your question at
Aug 9, 2013 at 5:57 PM
Btw. with ZXing.Net it works like expected.