mirror of
https://github.com/zxing/zxing.git
synced 2025-03-05 20:48:51 -08:00
Issue 1063 actionscript fixes to QR code encoding, and hopefully fixes without breaking some hash table behavior
git-svn-id: https://zxing.googlecode.com/svn/trunk@2069 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
parent
f2fe9dbd67
commit
05a5ffe486
|
@ -26,8 +26,8 @@
|
||||||
import com.google.zxing.common.flexdatatypes.HashTable;
|
import com.google.zxing.common.flexdatatypes.HashTable;
|
||||||
import com.google.zxing.common.flexdatatypes.IllegalArgumentException;
|
import com.google.zxing.common.flexdatatypes.IllegalArgumentException;
|
||||||
|
|
||||||
private static var VALUE_TO_ECI:HashTable = new HashTable(29);
|
private static var VALUE_TO_ECI:HashTable;
|
||||||
private static var NAME_TO_ECI:HashTable = new HashTable(29);
|
private static var NAME_TO_ECI:HashTable;
|
||||||
|
|
||||||
private static function initialize():void {
|
private static function initialize():void {
|
||||||
VALUE_TO_ECI = new HashTable(29);
|
VALUE_TO_ECI = new HashTable(29);
|
||||||
|
|
|
@ -17,7 +17,7 @@ package com.google.zxing.common.flexdatatypes
|
||||||
|
|
||||||
public function getIndexOf(key:Object):int
|
public function getIndexOf(key:Object):int
|
||||||
{
|
{
|
||||||
for (var i:int=0;i<this._arr.length;i++)
|
for (var i:String in this._arr)
|
||||||
{
|
{
|
||||||
if (this._arr[i][0] == key)
|
if (this._arr[i][0] == key)
|
||||||
{
|
{
|
||||||
|
@ -57,7 +57,7 @@ package com.google.zxing.common.flexdatatypes
|
||||||
|
|
||||||
public function ContainsKey(key:Object):Boolean
|
public function ContainsKey(key:Object):Boolean
|
||||||
{
|
{
|
||||||
for (var i:int=0;i<this._arr.length;i++)
|
for (var i:String in this._arr)
|
||||||
{
|
{
|
||||||
if (this._arr[i][0] == key) { return true; }
|
if (this._arr[i][0] == key) { return true; }
|
||||||
}
|
}
|
||||||
|
@ -67,7 +67,7 @@ package com.google.zxing.common.flexdatatypes
|
||||||
public function getValuesByKey(key:Object):ArrayList
|
public function getValuesByKey(key:Object):ArrayList
|
||||||
{
|
{
|
||||||
var al:ArrayList = new ArrayList();
|
var al:ArrayList = new ArrayList();
|
||||||
for (var i:int=0;i<this._arr.length;i++)
|
for (var i:String in this._arr)
|
||||||
{
|
{
|
||||||
if (this._arr[i][0] == key)
|
if (this._arr[i][0] == key)
|
||||||
{
|
{
|
||||||
|
@ -85,7 +85,7 @@ package com.google.zxing.common.flexdatatypes
|
||||||
public function getValueByKey(key:Object):Object
|
public function getValueByKey(key:Object):Object
|
||||||
{
|
{
|
||||||
var al:ArrayList = new ArrayList();
|
var al:ArrayList = new ArrayList();
|
||||||
for (var i:int=0;i<this._arr.length;i++)
|
for (var i:String in this._arr)
|
||||||
{
|
{
|
||||||
if (this._arr[i][0] == key)
|
if (this._arr[i][0] == key)
|
||||||
{
|
{
|
||||||
|
@ -97,7 +97,7 @@ package com.google.zxing.common.flexdatatypes
|
||||||
|
|
||||||
public function setValue(key:Object,value:Object):void
|
public function setValue(key:Object,value:Object):void
|
||||||
{
|
{
|
||||||
for (var i:int=0;i<this._arr.length;i++)
|
for (var i:String in this._arr)
|
||||||
{
|
{
|
||||||
if (this._arr[i][0] == key)
|
if (this._arr[i][0] == key)
|
||||||
{
|
{
|
||||||
|
@ -109,7 +109,7 @@ package com.google.zxing.common.flexdatatypes
|
||||||
|
|
||||||
public function getKeyByValue(value:Object):int
|
public function getKeyByValue(value:Object):int
|
||||||
{
|
{
|
||||||
for (var i:int=0;i<this._arr.length;i++)
|
for (var i:String in this._arr)
|
||||||
{
|
{
|
||||||
if (this._arr[i][1] == value)
|
if (this._arr[i][1] == value)
|
||||||
{
|
{
|
||||||
|
@ -121,7 +121,7 @@ package com.google.zxing.common.flexdatatypes
|
||||||
|
|
||||||
public function containsKey(key:Object):Boolean
|
public function containsKey(key:Object):Boolean
|
||||||
{
|
{
|
||||||
for (var i:int=0;i<this._arr.length;i++)
|
for (var i:String in this._arr)
|
||||||
{
|
{
|
||||||
if (this._arr[i][0] == key)
|
if (this._arr[i][0] == key)
|
||||||
{
|
{
|
||||||
|
|
|
@ -548,6 +548,7 @@ public final class Encoder {
|
||||||
else if (encoding == "ISO8859_11"){ bytes.writeMultiByte(content, "iso-8859-11"); }
|
else if (encoding == "ISO8859_11"){ bytes.writeMultiByte(content, "iso-8859-11"); }
|
||||||
else if (encoding == "ISO8859_15"){ bytes.writeMultiByte(content, "iso-8859-15"); }
|
else if (encoding == "ISO8859_15"){ bytes.writeMultiByte(content, "iso-8859-15"); }
|
||||||
else if ((encoding == "ISO-8859-1") || (encoding == "ISO8859-1")) { bytes.writeMultiByte(content, "iso-8859-1"); }
|
else if ((encoding == "ISO-8859-1") || (encoding == "ISO8859-1")) { bytes.writeMultiByte(content, "iso-8859-1"); }
|
||||||
|
else if ((encoding == "UTF-8") || (encoding == "UTF8")) { bytes.writeMultiByte(content, "utf-8"); }
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//other encodings not supported
|
//other encodings not supported
|
||||||
|
@ -601,4 +602,5 @@ public final class Encoder {
|
||||||
bits.appendBits(eci.getValue(), 8);
|
bits.appendBits(eci.getValue(), 8);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
}
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue