MCPcopy Create free account
hub / github.com/WheretIB/nullc / get_write_encoding

Function get_write_encoding

external/pugixml/pugixml.cpp:2477–2493  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2475 }
2476
2477 xml_encoding get_write_encoding(xml_encoding encoding)
2478 {
2479 // replace wchar encoding with utf implementation
2480 if (encoding == encoding_wchar) return get_wchar_encoding();
2481
2482 // replace utf16 encoding with utf16 with specific endianness
2483 if (encoding == encoding_utf16) return is_little_endian() ? encoding_utf16_le : encoding_utf16_be;
2484
2485 // replace utf32 encoding with utf32 with specific endianness
2486 if (encoding == encoding_utf32) return is_little_endian() ? encoding_utf32_le : encoding_utf32_be;
2487
2488 // only do autodetection if no explicit encoding is requested
2489 if (encoding != encoding_auto) return encoding;
2490
2491 // assume utf8 encoding
2492 return encoding_utf8;
2493 }
2494
2495#ifdef PUGIXML_WCHAR_MODE
2496 size_t get_valid_length(const char_t* data, size_t length)

Callers 2

xml_buffered_writerMethod · 0.85
saveMethod · 0.85

Calls 2

get_wchar_encodingFunction · 0.85
is_little_endianFunction · 0.85

Tested by

no test coverage detected