12 Commits

Author SHA1 Message Date
58caa542ac Add missing UTF-8 BOM
Many many many Windows out there are still using Windows-1252 and
similar ancient encodings.

Signed-off-by: Simon Rozman <simon@rozman.si>
2023-07-23 14:02:58 +02:00
82b25cc24a parser: add missing #include
Signed-off-by: Simon Rozman <simon@rozman.si>
2023-07-21 11:53:48 +02:00
c5f972971e parser: revise
Signed-off-by: Simon Rozman <simon@rozman.si>
2023-07-17 17:05:31 +02:00
aedb0921f2 parser: adopt changes from string
Signed-off-by: Simon Rozman <simon@rozman.si>
2023-07-17 12:57:23 +02:00
6cdcb08365 sgml: rename str -> wstr
The sgml.hpp is about converting between SGML and UTF-16/Unicode
actually. The "wstr" naming aligns better with std::wstring, wchar_t
etc.

Signed-off-by: Simon Rozman <simon@rozman.si>
2023-07-17 12:51:41 +02:00
1fb78a78f2 parser: Stabilize HTTP suite
Signed-off-by: Simon Rozman <simon@rozman.si>
2023-03-16 12:35:52 +01:00
b028c8772e parser: Cleanup
Signed-off-by: Simon Rozman <simon@rozman.si>
2023-03-16 12:35:08 +01:00
a59163733a parser: Add missing constructors to allow locale propagation
Classes using m_locale must allow locale configuration in their
constructor. Otherwise m_locale was always set to default by
basic_parser<> constructor.

Signed-off-by: Simon Rozman <simon@rozman.si>
2023-03-16 11:21:53 +01:00
38fac2837f parser: Duplicate locale
The Release testing revealed that compiler might free temporary
std::locale instances sooner than we thought, exposing UaF.

On 64-bit arch, a reference takes 8 bytes, a std::locale copy takes 16
bytes. So duplicating a locale in each parser instance is not such a big
deal to risk an UaF.

Signed-off-by: Simon Rozman <simon@rozman.si>
2023-03-16 11:02:23 +01:00
127704d2d8 parser: Rename "tester" to "parser"
Signed-off-by: Simon Rozman <simon@rozman.si>
2023-03-16 10:58:15 +01:00
33012e1513 parser: Use ranged for loops where appropriate
Signed-off-by: Simon Rozman <simon@rozman.si>
2023-03-16 09:38:53 +01:00
308f63490c Rename .h to .hpp
These files are C++ only. They should either have no extension like
standard C++ headers (which is cumbersome on Windows environments), or
.hpp.

.h is used for C and hybrid C/C++ headers.

Signed-off-by: Simon Rozman <simon@rozman.si>
2023-03-15 21:49:41 +01:00