summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Fix strncpy buffer lengthsJohn-Mark Bell2023-12-181-1/+1
|
* Transliteration fixes:John-Mark Bell2013-01-131-6/+21
| | | | | | | | | | | | * Clear any substitution if codec reset has been requested. * Don't report memory exhaustion when failing to allocate space for the test conversion in translit_try_sequence: there's nothing the caller can do, so treat it as if the substitution cannot be converted to the target character set. * Correctly report success if we run out of input immediately following a flush of a substitution. Additional tests for transliteration.
* Add proper transliteration support.John-Mark Bell2013-01-114-41/+1738
|
* Correct handling of trailing valid shift sequences. Previously wouldJohn-Mark Bell2013-01-061-2/+9
| | | | | | erroneously report EINVAL, instead of silently accepting them. Requires UnicodeLib 0.60.
* Update to new NSBUILD infrastructureDaniel Silverstone2012-06-291-1/+1
| | | | svn path=/trunk/iconv/; revision=14011
* First attempt at using the core buildsystemJohn Mark Bell2009-03-261-47/+2
| | | | svn path=/trunk/iconv/; revision=6897
* Improve error reporting from iconv_eightbit_new. This means we correctly ↵John Mark Bell2009-01-053-53/+71
| | | | | | | | return EINVAL if we can't find a mapping table, rather than assuming ENOMEM. Bump version number while we're at it. svn path=/trunk/iconv/; revision=5962
* Apparently, the compiler complains less when you initialise variables. Who'd ↵John Mark Bell2008-11-291-1/+1
| | | | | | have thought it?! svn path=/trunk/iconv/; revision=5831
* Fix resumption of decode after EINVAL.John Mark Bell2008-11-292-0/+27
| | | | | | iconv() expects to replay the whole sequence whereas UnicodeLib expects to resume where it left off. svn path=/trunk/iconv/; revision=5826
* Dump the list of known encoding aliases when asked. Don't expect any kind of ↵John Mark Bell2008-11-192-6/+5
| | | | | | sort order -- that would require a level of thought I don't have right now. svn path=/trunk/iconv/; revision=5746
* On RISC OS, use Unicode:, rather than attempting to getenv("Unicode$Path") ↵John Mark Bell2008-11-191-2/+2
| | | | | | and concatenating the leafname on the end. svn path=/trunk/iconv/; revision=5744
* Move the declarations of iconv_initialise/iconv_finalise to a different header.John Mark Bell2008-11-191-1/+1
| | | | | | | | | | | | | | | This keeps the public iconv.h free of such nonsense. Move the source for the RISC OS stubs to the distribution template tree. We will no longer shipped compiled stubs. People are quite capable of compiling this themselves. Also take the opportunity to tidy it up a bit. Bump the version number to 0.09 Introduce a "riscos-dist" target in Makefile-riscos. Update various bits of documentation. svn path=/trunk/iconv/; revision=5734
* Fix up output buffer length on memory exhaustionJohn Mark Bell2008-11-191-1/+5
| | | | svn path=/trunk/iconv/; revision=5733
* Fix strncasecmp implementation.John Mark Bell2008-11-191-1/+1
| | | | svn path=/trunk/iconv/; revision=5732
* Change previous logic -- we want to ignore U+FFFF regardless of the translit ↵John Mark Bell2008-11-181-1/+1
| | | | | | state. svn path=/trunk/iconv/; revision=5717
* Treat U+FFFF as invalid. Otherwise, we end up writing the first mapped out ↵John Mark Bell2008-11-181-1/+1
| | | | | | character encountered in the target encoding. svn path=/trunk/iconv/; revision=5716
* Rather less hideous approach to error detection and input pointer maintenence.John Mark Bell2008-11-182-154/+50
| | | | | | | | | We now simply decode one character at a time and check for error afterwards. This has the benefit of being less code, clearer, less likely to crash if encoding state changes involve memory (de)allocation, and removes the reliance on UnicodeLib internals. It's probably slower, however, but correctness is more important here. Fix ISO-2022-JP-2 test data to not include characters from the JIS X 0201-1976 Kana set -- this set is not used in ISO-2022-JP-2. Implement verbose flag in *Iconv. svn path=/trunk/iconv/; revision=5712
* Factor out acquisition of paths to files in the Unicode resource.John Mark Bell2008-11-161-52/+92
| | | | | | | This fixes *ReadAliases on <> RISC OS, and Iconv's eightbit codec. Fix iconv_eightbit_read to ensure that it treats the input as unsigned bytes. svn path=/trunk/iconv/; revision=5705
* Ensure that we return the correct errors and, when we do, point to the ↵John Mark Bell2008-11-163-39/+180
| | | | | | | | | | correct place in the input sequence (namely the start of the erroneous sequence). Unfortunately, UnicodeLib reads past the erroneous sequence so we previously returned a pointer to the middle/end of the sequence rather than the start. The only way I could think of doing this was to perform the conversion twice -- counting the number of successfully processed characters first, then to convert that number of characters again. We then play spot-the-difference with the output parameters to determine the correct return value. As encodings provided by UnicodeLib may be stateful, we need to be able to save the current state of the codecs and then restore them when we attempt the second conversion (otherwise, state-based encodings will do entirely the wrong thing). There's no API in UnicodeLib to do this and, given it's such an unlikely use case, I've not added any. Instead, we get to poke around in the UnicodeLib internals and do the save/restore ourselves. svn path=/trunk/iconv/; revision=5699
* Various hackery in a vain attempt to make more tests pass.John Mark Bell2008-11-141-2/+46
| | | | | | | | | | | | | Disable the UTF-8 test, as it currently fails: 1) A bug in UnicodeLib's UTF-8 decoder results in 0x80 being treated as valid input 2) There's no way of determining if U+FFFD was the result of invalid input or valid input which happened to decode to that codepoint 3) UnicodeLib drops U+FEFF on the floor Disable UCS-{2,4}{BE,LE}, as we don't support those encodings. svn path=/trunk/iconv/; revision=5694
* Oh look. US-ASCII was broken. There's a good indication if ever I saw one.John Mark Bell2008-11-131-0/+3
| | | | svn path=/trunk/iconv/; revision=5691
* Correctly reset codecs, including restoring their endianness/BOM flags.John Mark Bell2008-11-132-7/+24
| | | | | | Add support for UCS-4-INTERNAL, which is a platform-endian UCS4 variant. svn path=/trunk/iconv/; revision=5689
* Various fixes to make compilation with GCCSDK4 work.John Mark Bell2008-11-111-2/+0
| | | | | | Add an Iconv command (currently no code support) svn path=/trunk/iconv/; revision=5682
* Make module initialisation work sensibly on all platforms.John Mark Bell2008-11-112-2/+4
| | | | | | | Use UNICODE_DIR on non-RO as the path to the Unicode resource. Fix a bunch of logging statements that didn't use %zd for size_t. svn path=/trunk/iconv/; revision=5681
* Import Iconv sourcesJohn Mark Bell2008-11-107-0/+1350
svn path=/trunk/iconv/; revision=5677