I wrote this code a while ago, and I tested it with an actual bar code scanner.
The code detects automatically what subset to use, A, B or C.
For example, if you use only numbers, it will use Code128C, and if you mix, it will change the subset within the barcode. For example, if you use a string like "123456789abcdef", it will start with Code128C, then when it reaches the alpabet characters, it will change to Code128B in the same barcode.
Here's a screen shot of the sample application: