def truncate(s, length=1, etc="..."):
    """Truncate a string to the given length.

    If truncation is necessary, append the value of "etc".

    This is really just a silly test.

    """
    if len(s) < length:
        return s
    else:
        return s[:length] + etc
Truncate a string to the given length.

    If truncation is necessary, append the value of "etc".

    This is really just a silly test.

    
recipes/Python/492223_ProtectUTF8/recipe-492223.py