fix fallback charset handling

test if the fallback is set, do not rely on error code