Reset the encoding to original value since regex function doesn't accept encoding as argument