Commit Graph

13 Commits

Author SHA1 Message Date
Aatos Majava
3b2a528b33 LibTextCodec: Add Turkish (aka ISO-8859-9, Windows-1254) encoding 2021-06-23 16:32:47 +01:00
Aatos Majava
7597cca5c6 LibTextCodec: Add ISO-8859-15 (aka Latin-9) encoding 2021-06-15 15:12:09 +01:00
Max Wipfli
d325403cb5 LibTextCodec: Use Optional<String> for get_standardized_encoding
This patch changes get_standardized_encoding to use an Optional<String>
return type instead of just returning the null string when unable to
match the provided encoding to one of the canonical encoding names.

This is part of an effort to move away from using null strings towards
explicitly using Optional<String> to indicate that the String may not
have a value.
2021-05-18 21:02:07 +02:00
Idan Horowitz
87cabda80d LibTextCodec: Implement a Windows-1251 decoder
This encoding (a superset of ascii that adds in the cyrillic alphabet)
is currently the third most used encoding on the web, and because
cyrillic glyphs were added by Dmitrii Trifonov recently, we can now
support it as well :^)
2021-05-01 17:59:08 +02:00
Brian Gianforcaro
1682f0b760 Everything: Move to SPDX license identifiers in all files.
SPDX License Identifiers are a more compact / standardized
way of representing file license information.

See: https://spdx.dev/resources/use/#identifiers

This was done with the `ambr` search and replace tool.

 ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
2021-04-22 11:22:27 +02:00
Idan Horowitz
4a2c0d721f LibTextCodec: Implement a Windows-1255 decoder.
This is a superset of ascii that adds in the hebrew alphabet.
(Google currently assumes we are running windows due to not
recognizing Serenity as the OS in the user agent, resulting
in this encoding instead of UTF8 in google search results)
2021-04-17 18:13:20 +02:00
Nicholas-Baron
c4ede38542 Everything: Add -Wnon-virtual-dtor flag
This flag warns on classes which have `virtual` functions but do not
have a `virtual` destructor.

This patch adds both the flag and missing destructors. The access level
of the destructors was determined by a two rules of thumb:
1. A destructor should have a similar or lower access level to that of a
   constructor.
2. Having a `private` destructor implicitly deletes the default
   constructor, which is probably undesirable for "interface" types
   (classes with only virtual functions and no data).

In short, most of the added destructors are `protected`, unless the
compiler complained about access.
2021-04-15 20:57:13 +02:00
Idan Horowitz
c9f25bca04 LibTextCodec: Make UTF16BEDecoder read only up to an even offset
Reading up to the end of the input string of odd length results in
an out-of-bounds read
2021-03-15 16:08:12 +01:00
Luke
7427e3a8a6 LibTextCodec: Fix IBM666 => IBM866 typo 2021-03-14 11:27:52 +01:00
Andreas Kling
0538dc4e28 LibTextCodec: Add a simple UTF-16BE decoder 2021-02-16 17:31:22 +01:00
Ben Wiederhake
aa3d915260 LibTextCodec: Avoid duplicate definition of standard encodings 2021-02-01 09:54:32 +01:00
asynts
01879d27c2 Everywhere: Replace a bundle of dbg with dbgln.
These changes are arbitrarily divided into multiple commits to make it
easier to find potentially introduced bugs with git bisect.
2021-01-16 11:54:35 +01:00
Andreas Kling
13d7c09125 Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00