diff options
author | Arseny Kapoulkine <arseny.kapoulkine@gmail.com> | 2015-08-13 14:07:19 +0100 |
---|---|---|
committer | Arseny Kapoulkine <arseny.kapoulkine@gmail.com> | 2015-08-14 07:55:24 -0700 |
commit | ce4ac177801e31ffd309c91cb9e464d8cab205a3 (patch) | |
tree | 7f928cccb812bf6907af6ac76968accd333e7189 /docs/manual.adoc | |
parent | c55e5512355d23483d521d7c7dd38e67ba7835f9 (diff) |
docs: Clarify UTF-8 vs wchar_t memory efficiency
Diffstat (limited to 'docs/manual.adoc')
-rw-r--r-- | docs/manual.adoc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/docs/manual.adoc b/docs/manual.adoc index cd3d8f8..af48a10 100644 --- a/docs/manual.adoc +++ b/docs/manual.adoc @@ -420,7 +420,7 @@ bool xml_node::set_name(const wchar_t* value); [[char_t]][[string_t]] There is a special type, `pugi::char_t`, that is defined as the character type and depends on the library configuration; it will be also used in the documentation hereafter. There is also a type `pugi::string_t`, which is defined as the STL string of the character type; it corresponds to `std::string` in char mode and to `std::wstring` in wchar_t mode. -In addition to the interface, the internal implementation changes to store XML data as `pugi::char_t`; this means that these two modes have different memory usage characteristics. The conversion to `pugi::char_t` upon document loading and from `pugi::char_t` upon document saving happen automatically, which also carries minor performance penalty. The general advice however is to select the character mode based on usage scenario, i.e. if UTF-8 is inconvenient to process and most of your XML data is non-ASCII, wchar_t mode is probably a better choice. +In addition to the interface, the internal implementation changes to store XML data as `pugi::char_t`; this means that these two modes have different memory usage characteristics - generally UTF-8 mode is more memory and performance efficient, especially if `sizeof(wchar_t)` is 4. The conversion to `pugi::char_t` upon document loading and from `pugi::char_t` upon document saving happen automatically, which also carries minor performance penalty. The general advice however is to select the character mode based on usage scenario, i.e. if UTF-8 is inconvenient to process and most of your XML data is non-ASCII, wchar_t mode is probably a better choice. [[as_utf8]][[as_wide]] There are cases when you'll have to convert string data between UTF-8 and wchar_t encodings; the following helper functions are provided for such purposes: |