def _winpath2bytes_py3(text, codec):
    """Fallback implementation for text including surrogates"""

    # merge surrogate codepoints
    if _normalize_codec(codec).startswith("utf-16"):
        # fast path, utf-16 merges anyway
        return text.encode(codec, _surrogatepass)
    return _decode_surrogatepass(
        text.encode("utf-16-le", _surrogatepass),
        "utf-16-le").encode(codec, _surrogatepass)
def _winpath2bytes_py3 ( text , codec ) : if _normalize_codec ( codec ) . startswith ( "utf-16" ) : return text . encode ( codec , _surrogatepass ) return _decode_surrogatepass ( text . encode ( "utf-16-le" , _surrogatepass ) , "utf-16-le" ) . encode ( codec , _surrogatepass )
Fallback implementation for text including surrogates