Implements of surrogate mode.