Cannot decode utf-8 properlu using as version of library

20 views
Skip to first unread message

Piotr Kubacki

unread,
Apr 16, 2014, 2:21:31 PM4/16/14
to zx...@googlegroups.com
I am using AS version of library, and have problems with decoding utf-8 (polish to be specific). Does anyone has a solution to this?

Sean Owen

unread,
Apr 16, 2014, 2:23:05 PM4/16/14
to zx...@googlegroups.com
When you say "have problems" you really should give any detail at all.

Piotr Kubacki

unread,
Apr 16, 2014, 2:39:37 PM4/16/14
to zx...@googlegroups.com
W dniu środa, 16 kwietnia 2014 20:21:31 UTC+2 użytkownik Piotr Kubacki napisał:
> I am using AS version of library, and have problems with decoding utf-8 (polish to be specific). Does anyone has a solution to this?

instead of encoded message ąśżźćółń I get ąśżźćęńłó

Sean Owen

unread,
Apr 16, 2014, 2:48:45 PM4/16/14
to zx...@googlegroups.com
How did you encode it? how did you decode? display? there are lots of points where this can go wrong, and most are not to do with the library. Start by showing your barcode.

Piotr Kubacki

unread,
Apr 16, 2014, 3:29:51 PM4/16/14
to zx...@googlegroups.com
W dniu środa, 16 kwietnia 2014 20:21:31 UTC+2 użytkownik Piotr Kubacki napisał:
> I am using AS version of library, and have problems with decoding utf-8 (polish to be specific). Does anyone has a solution to this?

I am using online generator http://www.qr-online.pl/index.php for testing.
Here is How I decode it
var qrCodeReader:QRCodeReader = new QRCodeReader();
var lsource:BufferedImageLuminanceSource=new BufferedImageLuminanceSource(bitmapData);
var bitmap:BinaryBitmap=new BinaryBitmap(new GlobalHistogramBinarizer(lsource));

var ht:HashTable=null;
ht=this.getAllHints();

var result:Result=null;
try {
result=qrCodeReader.decode(bitmap, ht);
}
catch (error:Error)
{
trace("decoding error");
return;
}




private function getAllHints():HashTable
{
var ht:HashTable=new HashTable();
ht.Add(DecodeHintType.POSSIBLE_FORMATS, BarcodeFormat.QR_CODE);
ht.Add(EncodeHintType.CHARACTER_SET, "UTF-8");
return ht;
}
97d37fdddf31bfd0a693f00304f00d97-get.jpg

Sean Owen

unread,
Apr 16, 2014, 5:12:33 PM4/16/14
to zx...@googlegroups.com
This code correctly encodes "ąśżźćółń", and is correctly decoded by the core library:

Piotr Kubacki

unread,
Apr 16, 2014, 11:32:18 PM4/16/14
to zx...@googlegroups.com
W dniu środa, 16 kwietnia 2014 20:21:31 UTC+2 użytkownik Piotr Kubacki napisał:
> I am using AS version of library, and have problems with decoding utf-8 (polish to be specific). Does anyone has a solution to this?

I have checked the java version of the library and it works. I have problem with AS. Have anyone fixed that problem? I need quick solution.
Reply all
Reply to author
Forward
0 new messages