When inserting characters, your program must not insert them between the first byte and the second byte of a DBCS character.
When the second byte of a DBCS character happens to overflow by inserting characters into the specified buffer, the fragment or the first byte of the DBCS character, should be substituted by either an SBCS blank or null.
Example Source Data 0 0 0 0 0 0 0 0 0 1 1 1 1 2 3 4 5 6 7 8 9 0 1 2 ┌─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┐ │s│s│s│D 1│D 2│D 3│n│n│n│ where 'n' denotes null. └─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┘ After insertion operation 1. insert string 'ee' at 8th byte ┌─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┐ │s│s│s│D 1│D 2│e│e│D 3│n│ └─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┘ 2. insert string 'ee' at 9th byte This operation should be inhibited. 3. insert string 'eeD4' at 6th byte ┌─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┐ │s│s│s│D 1│e│e│D 4│D 2│n│ └─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┘
See Insertion part for overflow.