tools/json_to_struct/element_generator.py
def _JSONToCString16(json_string_literal):
  """Converts a JSON string literal to a C++ UTF-16 string literal. This is
  done by converting \\u#### to \\x####.
  """
  c_string_literal = json_string_literal
  escape_index = c_string_literal.find('\\')
  while escape_index > 0:
    if c_string_literal[escape_index + 1] == 'u':
      # We close the C string literal after the 4 hex digits and reopen it right
      # after, otherwise the Windows compiler will sometimes try to get more
      # than 4 characters in the hex string.
      c_string_literal = (c_string_literal[0:escape_index + 1] + 'x' +
          c_string_literal[escape_index + 2:escape_index + 6] + '" L"' +
          c_string_literal[escape_index + 6:])
    escape_index = c_string_literal.find('\\', escape_index + 6)
  return c_string_literal
Converts a JSON string literal to a C++ UTF-16 string literal. This is
  done by converting \\u#### to \\x####.
  
Converts a JSON string literal to a C++ UTF-16 string literal.
Converts a JSON string literal to a C ++ UTF - 16 string literal .
def _JSONToCString16(json_string_literal):
  c_string_literal = json_string_literal
  escape_index = c_string_literal.find('\\')
  while escape_index > 0:
    if c_string_literal[escape_index + 1] == 'u':
      c_string_literal = (c_string_literal[0:escape_index + 1] + 'x' +
          c_string_literal[escape_index + 2:escape_index + 6] + '" L"' +
          c_string_literal[escape_index + 6:])
    escape_index = c_string_literal.find('\\', escape_index + 6)
  return c_string_literal
def _JSONToCString16 ( json_string_literal ) : c_string_literal = json_string_literal escape_index = c_string_literal . find ( '\\' ) while escape_index > 0 : if c_string_literal [ escape_index + 1 ] == 'u' : c_string_literal = ( c_string_literal [ 0 : escape_index + 1 ] + 'x' + c_string_literal [ escape_index + 2 : escape_index + 6 ] + '" L"' + c_string_literal [ escape_index + 6 : ] ) escape_index = c_string_literal . find ( '\\' , escape_index + 6 ) return c_string_literal
Converts a JSON string literal to a C++ UTF-16 string literal.
Converts a JSON string literal to a C ++ UTF - 16 string literal .
"""Converts a JSON string literal to a C++ UTF-16 string literal. This is
  done by converting \\u#### to \\x####.
  """ # We close the C string literal after the 4 hex digits and reopen it right # after, otherwise the Windows compiler will sometimes try to get more # than 4 characters in the hex string.
json_string_literal