This project is read-only.

Structure for Encode

Coordinator
Oct 28, 2011 at 6:28 AM

Currently Encoder method from EncoderBase will output data header and data base all together. That will require variable version for EncoderBase.

Which technically you can not decide version until you know the bit size of DataBits for input content. 

In ZXing's code they just assume header will cost max space. 4 bits for mode indicator and 16 bit as EightBitByte char count indicator. Which is not efficient. Way too many assume will make use of version sometime larger than the one we should actually use. 

Also for ZXing's code. Their version detector totally ignore ECI indicator. So it might happen some version can not fully contain the bits we wanna to store. It haven't had any error just because ECI will only exist at EightBitByte encoder and only if encoding is not default encoding. 

I have changed version detector method according to ISO/IEC. It will count ECI indicator and dynamically check version with different level of char count indicator. 

Thus my suggestion is change Encoderbase  structure. Make it able to convert content without version requirement, and use it's result inside VersionControl to decide which version to use. Then we can add header before actual content.