This isn't a question we can answer without being able to see your code - both Bar and source - and knowing exactly what you are trying to encode.
Code128 is a variable length code, which can contain a huge amount of information in a mixture of three code sets: so it's a complicated beastie, especially compared to simpler codes such as ITF14.
I'd start by finding a "working" Code128 barcode of the right length and reading it's data, then using your code to encode that into a "new" barcode. Are they the same? Are the quiet zones valid at both ends of the new code?
You need to read up on them -
Code 128 - Wikipedia[
^] is a start, but you will probably need to learn a lot more to diagnose this problem!