summaryrefslogtreecommitdiff
path: root/libarchive/archive_string.h
Commit message (Collapse)AuthorAgeFilesLines
* Complete support for UTF8 encoding conversionYichao Yu2020-05-311-1/+1
| | | | | | | | | | | | | All the conversions already always go through the MBS form so simply always convert to MBS before trying to convert to any other encoding in the `archive_mstring_get_*` functions. * Do this by calling `archive_mstring_get_mbs` to avoid duplicating code * Add `struct archive*` parameter to `archive_mstring_get_mbs_l` * Add test for set/get/update utf8 functions on entry * Add test for encoding conversion. Fix #931
* Unify header style, header guard comes firstMartin Matuska2020-01-131-3/+3
| | | | Found by LGTM.com code analysis
* Introduce archive_array_append to append a raw array to an archive_stringStefan Berger2017-01-081-0/+4
| | | | | | | | | Introduce archive_array_append to append a raw array to an archive_string. We need this for binary values in the PAX header. We can append arbitray data to the archive_string since its string append operations simply append at the end pointer rather than walking the string and appending at the zero byte.
* Spelling fixes (#831)Graham Percival2016-12-041-2/+2
| | | Sponsored by: Tarsnap Backup Inc.
* Rename some internal functions as other related functions.Michihiro NAKAJIMA2012-03-171-4/+4
| | | | | | archive_strcpy_in_locale ==> archive_strcpy_l archive_strncpy_in_locale ==> archive_strncpy_l archive_strncat_in_locale ==> archive_strncat_l
* Impelment Unicode normalization Form D in libarchive itself in order not to ↵Michihiro NAKAJIMA2012-03-151-0/+2
| | | | | | rely on CoreServices framework on Mac OS. It passes all NormalizationTest.txt released The Unicode Consortium(http://www.unicode.org).
* Rework enabling a operation to a wrong UTF-8 string made with Libarchive 2.x.Michihiro NAKAJIMA2011-06-081-0/+3
| | | | SVN-Revision: 3399
* Implement a string conversion interface to archive_entry and archive_mstringMichihiro NAKAJIMA2011-05-091-1/+7
| | | | | | | | | for efficient string conversion. Some platform have to do a string conversion through wide characters. And then Windows platform cannot make locale UTF-8, so it means use of wide characters is only way to make a internationalization program. SVN-Revision: 3288
* Change the interface of archive_mstring_get_{utf8,mbs,wcs} so that we will ↵Michihiro NAKAJIMA2011-05-051-3/+3
| | | | | | be able to know the conversion result. SVN-Revision: 3283
* Rename archive_string_append_from_wcs_to_mbs function to ↵Michihiro NAKAJIMA2011-04-111-1/+1
| | | | | | archive_string_append_from_wcs. SVN-Revision: 3207
* Remove first argument of ↵Michihiro NAKAJIMA2011-04-111-3/+3
| | | | | | | | archive_wstring_append_from_mbs/archive_string_append_from_wcs_to_mbs. It is no longer needed for WCS<==>MBS conversion. SVN-Revision: 3206
* IntroduceMichihiro NAKAJIMA2011-04-071-2/+12
| | | | | | | | | archive_string_default_conversion_for_read() and archive_string_default_conversion_for_write() for conversion CP_ACP <==> CP_OEMCP(as charset for archive file) on Windows platform. Those functions on non-Windows platform always return NULL. SVN-Revision: 3172
* Rename archive_string_append_from_unicode_to_mbs back to ↵Michihiro NAKAJIMA2011-04-061-1/+1
| | | | | | | | archive_string_append_from_wcs_to_mbs since we have changed the handling of WCS. we are free from WCS format. SVN-Revision: 3167
* test_archive_string.c: tests for some archive_string operationsRoman Neuhauser2011-04-041-0/+2
| | | | SVN-Revision: 3162
* Improve character-set conversion functions.Michihiro NAKAJIMA2011-03-281-36/+19
| | | | | | | | | | | | | | - Change the interface in order to reduece the comparison of charset names. Previous version always did it when the functions were called; it was very inefficient. So I have made a conversion object, struct archive_string_conv, to resolve that issue. - Integrate *_from_charset and *_to_charset into *_in_locale because of above. - Integrate *_from_utf16be and *_to_utf16be into *in_locale. - On Windows, Make a codepage from a charset name to know whether current codepage and specified charset are the same or not. SVN-Revision: 3108
* Update comment about the return code of conversion functions.Michihiro NAKAJIMA2011-03-251-1/+1
| | | | | | | archive_string_append_from_unicode_to_mbs always returns -1 if the platform have neither wctomb nor wcrtomb. SVN-Revision: 3076
* Remove UTF-8 <===> WCS conversion code, which was highly based on the wrogMichihiro NAKAJIMA2011-03-251-4/+0
| | | | | | | | | assumption that WCS was UNICODE. What format WCS has is deeply dependent on platform, and WCS must be converted to/from locale dependent MBS on every platform through mbstowcs/wcstombs or related functions, which the platforms provide. We should, thus, respect the platform policy about WCS for potability. SVN-Revision: 3074
* Add an mbs version of ACL control functions in order to reduceMichihiro NAKAJIMA2011-03-251-0/+2
| | | | | | | | | | | | | extra character conversion. previous: Create : Disk -> MBS -> WCS -> MBS -> UTF-8 -> Pax archive file. Extract: Pax archive file -> UTF-8 -> MBS -> WCS ->MBS -> Disk. after: Create : Disk -> MBS -> UTF-8 -> Pax archive file. Extract: Pax archive file -> UTF-8 -> MBS -> Disk. SVN-Revision: 3073
* Add a check that a conversion specified by a charset option works on the ↵Michihiro NAKAJIMA2011-03-221-0/+8
| | | | | | platform. SVN-Revision: 3050
* Improve character-set conversion functions.Michihiro NAKAJIMA2011-03-221-4/+14
| | | | | | | | | - rename archive_strncpy_from_specific_locale to archive_strncat_from_locale. - rename archive_strncpy_to_specific_locale to archive_strncat_to_locale. - add archive_strncpy_[to/from]_locale functions. - add archive_strcpy_[to/from]_locale functions. SVN-Revision: 3049
* Add charset conversion functions which convert a string between Michihiro NAKAJIMA2011-03-171-0/+13
| | | | | | current locale and specific locale with iconv. SVN-Revision: 3021
* Improve UTF-16BE conversion functions.Michihiro NAKAJIMA2011-03-171-4/+4
| | | | | | | | | - rename archive_string_copy_from_utf16be to archive_strncpy_from_utf16be. - rename archive_string_copy_to_utf16be to archive_strncpy_to_utf16be and change its argument from struct archive_string * to a set of const char * and size_t. SVN-Revision: 3020
* Move a conversion of UTF-16BE, which is used for Joliet extensions, intoMichihiro NAKAJIMA2011-03-161-0/+12
| | | | | | archive_string.c, and Use iconv for it if available. SVN-Revision: 3019
* Fix some broken tests from the earlier string workTim Kientzle2011-03-071-10/+9
| | | | | | and refactor the charset conversion routines to be more consistent. SVN-Revision: 2993
* Switch archive_string character set conversion over to use iconv()Tim Kientzle2011-03-061-6/+8
| | | | | | | when it's available. See Issue 66 and Issue 132 for more discussion. SVN-Revision: 2992
* Rename archive_wstrappend_mbs to archive_wstrcpy_mbs to better reflect what ↵Tim Kientzle2010-12-071-1/+1
| | | | | | it actually does. SVN-Revision: 2818
* Big string overhaul:Tim Kientzle2010-11-191-60/+65
| | | | | | | | | | | * Remove __ from names (ISO C reserves names prefixed with __) * Remove the gratuitous macro wrappers * Remove a couple of unused functions * Try to simplify some of the implementations a bit more. * Move the "archive entry string" (aes) functions into archive_string as "archive_multistring" so these can be used outside of archive_entry SVN-Revision: 2791
* On Windows, use UNICODE version APIs to exceed the limitation of path length.Michihiro NAKAJIMA2010-07-091-0/+9
| | | | SVN-Revision: 2532
* Don't abuse typecasts, fix a build failure on FreeBSD 7.3.Tim Kientzle2010-07-081-2/+2
| | | | SVN-Revision: 2527
* Merge branches/wstring: This adds a new archive_wstringTim Kientzle2010-06-261-6/+32
| | | | | | | type for unicode strings and uses it to simplify some of the code in archive_entry. SVN-Revision: 2508
* Add __LA_PRINTF to enable format-string checks for GCC.Joerg Sonnenberger2010-02-251-2/+5
| | | | SVN-Revision: 1987
* Sync $FreeBSD$ version info from FreeBSD SVNTim Kientzle2009-12-301-1/+1
| | | | SVN-Revision: 1786
* Encourage people not to use libarchive internal headers.Tim Kientzle2009-08-111-0/+4
| | | | SVN-Revision: 1363
* As suggested by Joerg Sonnenberger, change archive_strncat() toTim Kientzle2009-03-091-1/+5
| | | | | | | | take a void * source instead of char *. In particular, this should reduce the number of gratuitous casts in code that uses "unsigned char *". SVN-Revision: 751
* Fix %ju handling in archive_string_sprintf()Tim Kientzle2009-01-281-5/+0
| | | | SVN-Revision: 505
* IFCTim Kientzle2008-12-051-1/+1
| | | | SVN-Revision: 266
* Add a fuzz tester to the libarchive test suite. ThisTim Kientzle2008-11-221-0/+6
| | | | | | | | | | | | takes known-good archives, changes random bytes, then feeds them through libarchive trying to provoke a crash or hang. This has exposed a couple of problems reading malformed ISO9660 images. As a result, I now have a rewritten Rockridge extension parser, better handling of malformed PVDs, and some additional checks around end-of-archive conditions. SVN-Revision: 260
* IFCTim Kientzle2008-06-141-1/+1
| | | | SVN-Revision: 118
* FreeBSD 4.11 doesn't define wchar_t in <wchar.h>, so use <stdlib.h>Tim Kientzle2008-06-071-0/+3
| | | | | | Thanks to: Jeremy C. Reed SVN-Revision: 108
* IFCTim Kientzle2008-05-281-1/+1
| | | | SVN-Revision: 102
* Synchronize a bunch of changes from my local tree.Tim Kientzle2008-04-301-6/+20
| | | | SVN-Revision: 5
* IFC to populate initial libarchive-portable tree.Tim Kientzle2008-04-291-0/+122
SVN-Revision: 1