MCPcopy Create free account
hub / github.com/Aloshi/EmulationStation / xml_encoding get_write_encoding

Function xml_encoding get_write_encoding

src/pugiXML/pugixml.cpp:2661–2677  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2659 }
2660
2661 PUGI__FN xml_encoding get_write_encoding(xml_encoding encoding)
2662 {
2663 // replace wchar encoding with utf implementation
2664 if (encoding == encoding_wchar) return get_wchar_encoding();
2665
2666 // replace utf16 encoding with utf16 with specific endianness
2667 if (encoding == encoding_utf16) return is_little_endian() ? encoding_utf16_le : encoding_utf16_be;
2668
2669 // replace utf32 encoding with utf32 with specific endianness
2670 if (encoding == encoding_utf32) return is_little_endian() ? encoding_utf32_le : encoding_utf32_be;
2671
2672 // only do autodetection if no explicit encoding is requested
2673 if (encoding != encoding_auto) return encoding;
2674
2675 // assume utf8 encoding
2676 return encoding_utf8;
2677 }
2678
2679#ifdef PUGIXML_WCHAR_MODE
2680 PUGI__FN size_t get_valid_length(const char_t* data, size_t length)

Callers

nothing calls this directly

Calls 1

is_little_endianFunction · 0.85

Tested by

no test coverage detected