Prevent segfaults when changing charset options
Fix reset of charset options (like 'cpoptions')

It could result in segmentation faults.
Merge branch 'fix-charset-options-reset'

Fix reset of charset options (like 'cpoptions'), which could result in
segmentation faults.