def string_to_numeric_char_reference(string):
    """
    Encode a string to HTML-compatible numeric character reference.
    Eg: encode_html_entities("abc") == '&#97;&#98;&#99;'
    """
    out = ''
    for char in string:
        out += '&#' + str(ord(char)) + ';'
    return out
