[ruby-core:99482] Re: Reduction of ENCODER files for embedded systems
From:
Martin J. Dürst <duerst@...>
Date:
2020-08-05 07:14:21 UTC
List:
ruby-core #99482
On 05/08/2020 02:27, Maurice Smulders wrote: > What is the best way to not build/remove the encoder files in enc and > trans in the ruby source tree? > > I am building for an embedded system. The code running on it will only > ever support USASCII, and reduction of size is paramount... > > Thanks, > Hello Maurice, I have been involved in the transcoding part, but that was quite some time ago. First, for embedded systems, I'd definitely also have a look at mruby (http://mruby.org/). Second, I'd have a look at miniruby, which uses only a few encodings. Third, I'd just start by removing some of the relevant files in enc and enc/trans, and see what happens (with the make process, testing,...). Quite some effort, such as the automatic generation of encdb.h and transdb.h, went into making sure (at least in theory) that new encodings/transcodings could be added easily. On the other hand, many encodings turn up in special situations, and it may be somewhat difficult to get rid of them. In particular, I'd start removing encodings labeled as Japanese/Korean/Chinese (because they use relatively more data), then move on to the various Windows-xxxx and ISO-8859-XX variants, leaving UTF-16/32, ISO-8859-1, ASCII-8BIT (aka BINARY), and UTF-8 for later. In particular UTF-8 may be difficult to remove, because it is used as the default source encoding, and there are many optimizations because it's widely used and has a very special structure. Please feel free to ask here again if you run into any issues. Regards, Martin. Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe> <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>