Commit Graph

15 Commits

Author SHA1 Message Date
Orgad Shaneh
7a4e5612de JANITORIAL: Replace new[]/memset with new[]()
Mostly done using the following Ruby script:

(Dir.glob('**/*.cpp') + Dir.glob('**/*.h')).each do |file|
  s = File.read(file, encoding: 'iso8859-1')
  t = s.gsub(/(([\w_.\[\]]+)\s*=\s*new\s+\S+?\[[^\]]+?\](?!\())([^\{\}]*?)\n\s+memset\(\s*\2\s*,\s*0\s*,[^;]*;/m, '\1()\3')
  if t != s
    File.open(file, 'w') { |io| io.write(t) }
  end
end
2021-11-10 19:53:15 +01:00
Orgad Shaneh
b983c1f29f COMMON: Add conversion table for DOS862 encoding 2021-07-22 00:06:25 +03:00
Orgad Shaneh
3ce662f5d4 COMMON: Fix indentation 2021-07-16 15:23:39 +03:00
djsrv
671fdf8cd9 COMMON: Add MacRoman codepage 2021-07-12 15:41:21 -04:00
Orgad Shaneh
a05e54f00c JANITORIAL: Remove trailing whitespaces 2021-05-04 11:46:30 +03:00
Eugene Sandulenko
5e7fe2dc57
JANITORIAL: Replace spaces in indentation with tabs 2021-04-15 21:20:36 +02:00
Le Philousophe
5cdb300534 COMMON: Fix CJK encode/decode and make valgrind quiet
CJK offsets were wrong compared to encodings.dat file and buffers were
read past their end.
Rewrote indexing to make it match the Python script and optimize
slightly
2021-04-10 23:36:55 +02:00
Le Philousophe
58f728a042 COMMON: Fix UTF-16 decoding
In case of 4-bytes codepoints, length wasn't decreased.
If codepoint is invalid don't eat the second code unit to let
resynchronization happen.
2020-12-01 19:43:20 +01:00
Vladimir Serbinenko
68a9136e4d
COMMON: Rewrite Encoder and drop dependency on iconv (#2586)
Different platforms have different levels of support of encodings and
often have slight variations. We already have tables for most encoding
with only CJK missing. Full transcoding inclusion allows us to get reliable
encoding results independently of platform. The biggest con is the need for
external tables encoding.dat.

It removes a duplicate table for korean in graphics/korfont.cpp
2020-11-15 16:20:35 +01:00
Cameron Cawley
6e0c93dc46 COMMON: Add helper functions for converting strings 2020-09-12 11:59:23 +02:00
lolbot-iichan
d8951b2aa1 COMMON: Add Persian language & CP1256 encoding 2020-05-18 23:24:15 +02:00
Eugene Sandulenko
5825a30b67 JANITORIAL: Whitespace fixes 2019-12-13 00:02:38 +01:00
Eugene Sandulenko
4b0fcd411b COMMON: Fix string length in U32String::encode()
Our method expects length in bytes, not in characters, which is 4x for U32
2019-12-12 23:59:58 +01:00
Le Philousophe
6aaec02c57 COMMON: Add CJK encodings to Common::CodePage
Use Encoding::convert to do the conversion first and try old method if
it fails
2019-11-30 13:34:33 +02:00
Eugene Sandulenko
50822e708b COMMON: Moved string encoding to separate file 2019-10-19 17:38:26 +02:00