def unicode_to_c_ustring(string):
  """Converts a Python unicode string to a C++ u16-string literal.

    >>> unicode_to_c_ustring(u'b\u00fccher.de')
    'u"b\\\\u00fccher.de"'
    """
  result = ['u"']
  for c in string:
    if (ord(c) > 0xffff):
      escaped = '\\U%08x' % ord(c)
    elif (ord(c) > 0x7f):
      escaped = '\\u%04x' % ord(c)
    else:
      escaped = c
    result.append(escaped)
  result.append('"')
  return ''.join(result)