diff options
author | Max Wipfli <mail@maxwipfli.ch> | 2021-05-12 10:32:41 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-05-18 21:02:07 +0200 |
commit | 67a9ebc8176e6dff4c3af3bc26ef3de829d87286 (patch) | |
tree | 7d1aee3464e2d5c67a2027878abc45be80e77dfa /Userland/Libraries/LibSQL/SyntaxHighlighter.cpp | |
parent | a7681dbeea882456915e01a12095429460a0df30 (diff) | |
download | serenity-67a9ebc8176e6dff4c3af3bc26ef3de829d87286.zip |
LibWeb: Change Document's m_encoding to Optional<String>
This modifies the Document class to use Optional<String> for the
encoding. If the encoding is unknown, the Optional will not have a
value. It also implements the has_encoding() and encoding_or_default()
instance methods, the latter of which will return "UTF-8" as a fallback
if no encoding is present.
The usage of Optional<String> instead of the null string is part of an
effort to explicitly indicate that a string could not have a value.
This also modifies the former callers of encoding() to use
encoding_or_default(). Furthermore, the encoding will now only be set if
it is actually known, rather than just guessed by earlier code.
Diffstat (limited to 'Userland/Libraries/LibSQL/SyntaxHighlighter.cpp')
0 files changed, 0 insertions, 0 deletions