* xmlTextReaderConstEncoding: * @reader: the xmlTextReaderPtr used * * Determine the encoding of the document being read. * * Returns a string containing the encoding of the document or NULL in * case of error. The string is deallocated with the reader. */
| 2940 | * case of error. The string is deallocated with the reader. |
| 2941 | */ |
| 2942 | const xmlChar * |
| 2943 | xmlTextReaderConstEncoding(xmlTextReaderPtr reader) { |
| 2944 | const xmlChar *encoding = NULL; |
| 2945 | |
| 2946 | if (reader == NULL) |
| 2947 | return(NULL); |
| 2948 | |
| 2949 | if (reader->ctxt != NULL) |
| 2950 | encoding = xmlGetActualEncoding(reader->ctxt); |
| 2951 | else if (reader->doc != NULL) |
| 2952 | encoding = reader->doc->encoding; |
| 2953 | |
| 2954 | return(constString(reader, encoding)); |
| 2955 | } |
| 2956 | |
| 2957 | |
| 2958 | /************************************************************************ |
nothing calls this directly
no test coverage detected