summaryrefslogtreecommitdiff
path: root/lib/util/charset/charset.h
AgeCommit message (Collapse)AuthorFilesLines
2011-09-20lib/util/charset: remove charset module loadingAndrew Bartlett1-5/+4
Now that the 'table' modules are gone, there is no reason for there to be charset modules at all. This builds the macosxfs and weird modules into the binary at the appropriate times, and changes the tests to test instead the difference between the remaining internal handlers and iconv(). Andrew Bartlett Autobuild-User: Andrew Bartlett <abartlet@samba.org> Autobuild-Date: Tue Sep 20 06:27:06 CEST 2011 on sn-devel-104
2011-09-20lib/util/charcnv: Remove broken internal CP850 and CP464 modulesAndrew Bartlett1-92/+0
These modules are now known to be faulty, and Samba 3.6.0 didn't include support for them, so we now require a system iconv if you wish to support these character sets for the non-ASCII range. Andrew Bartlett
2011-09-10lib/util/charset Run charset sets with and without the system iconvAndrew Bartlett1-1/+2
We need to know that we can load the samba-provided modules, and that they are correct. However, we must mark a number of tests as knownfail due to errors in our internal iconv modules. Andrew Bartlett
2011-07-19Second part of fix for bug 8310 - toupper_ascii() is broken on big-endian ↵Jeremy Allison1-0/+1
systems. Re-add: smb_ucs2_t toupper_w(smb_ucs2_t v); and ensure it is called whenever we are operating on smb_ucs2_t variables. I'd like to make the definition of smb_ucs2_t incompatible with int and codepoint_t so they can't be mixed, but that's a patch for another time. Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Tue Jul 19 23:48:05 CEST 2011 on sn-devel-104
2011-07-19First part of fix for bug 8310 - toupper_ascii() is broken on big-endian systemsJeremy Allison1-4/+0
Remove int toupper_ascii(int c); int tolower_ascii(int c); int isupper_ascii(int c); int islower_ascii(int c); and replace with their _m equivalents, as they are identical.
2011-06-23lib/util/charset: Remove 'display charset'Andrew Bartlett1-4/+2
As discussed in 'CH_DISPLAY and gettext' on the samba-technical list: http://lists.samba.org/archive/samba-technical/2011-June/078190.html Setting this to a value other than 'unix charset' does not make sense, as any system where the filesytem charset does not equal the terminal charset will already have problems with programs as simple as 'ls'. It also means that our output could not be pasted as our input in interactive programs or onto our command line, as we never did translate in the DISPLAY -> UNIX direction. The d_printf() calls are retained in case we need to revisit this, and to support display_set_stderr(). Andrew Bartlett
2011-05-13lib/util/charset Move built-in charset modules to the top levelAndrew Bartlett1-1/+1
This removes the 'charset' subsystem and allows these modules to be used across the whole of Samba. Andrew Bartlett
2011-05-03Remove strlower_m() and strupper_m() from source4 and common code.Andrew Bartlett1-7/+0
This function is problematic because a string may expand in size when changed into upper or lower case. This will then push characters off the end of the string in the s3 implementation, or panic in the former s4 implementation. Andrew Bartlett
2011-04-29lib/util/charset Move strstr_m() to the top levelAndrew Bartlett1-0/+1
2011-04-13lib/util/charset Add convert_string_error()Andrew Bartlett1-0/+4
This adds an interface that matches the source3/ convert string code. Andrew Bartlett Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-04-13lib/util/charset Fix and add public interface for convert_string_error_handleAndrew Bartlett1-0/+6
It makes much more sense for this to match the source3/ interface and return a bool. Andrew Bartlett Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-04-13lib/util/charset Move source3/lib/util_unistr.c to the common code.Andrew Bartlett1-0/+20
This file (largely) contains functions to deal with UTF16 strings. Andrew Bartlett Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-03-31lib/util/charset Add tests for strcasecmp_m(), talloc_strupper() et alAndrew Bartlett1-0/+12
This adds tests for: strncasecmp_m strcasecmp_m strupper_talloc_n strlower_talloc strhaslower strhasupper The tests can certainly be improved with pre-calculated upper and lower case text, but this at least puts them though their paces. Andrew Bartlett Autobuild-User: Andrew Bartlett <abartlet@samba.org> Autobuild-Date: Thu Mar 31 14:24:22 CEST 2011 on sn-devel-104
2011-03-31lib/util/charset Add wrapper to allow testing of strlen_m_ext()Andrew Bartlett1-0/+8
This allows test routines to force in particular character sets, and not rely on the smb.conf. Andrew Bartlett
2011-03-30Fix convert_string() to take a *converted_size arg. and return a bool.Jeremy Allison1-2/+3
Makes these interfaces much harder to misuse and easier to ensure error checking. Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Wed Mar 30 23:59:37 CEST 2011 on sn-devel-104
2011-03-30lib/util/charset Add tests for convert_string_talloc_handle()Andrew Bartlett1-0/+4
Andrew Bartlett Autobuild-User: Andrew Bartlett <abartlet@samba.org> Autobuild-Date: Wed Mar 30 13:02:47 CEST 2011 on sn-devel-104
2011-03-25lib/util/charset rename iconv_convenience to iconv_handleAndrew Bartlett1-13/+13
This better reflects what this structure is Andrew Bartlett
2011-03-25unistr: moved some UCS2 macros into util_unistrAndrew Tridgell1-9/+0
we need to move towards eliminating smb_ucs2_t. This moves a couple of the related macros into the only file they are used in Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-03-24charcnv: removed the allow_badcharcnv and allow_bad_conv options to ↵Andrew Tridgell1-9/+7
convert_string*() we shouldn't accept bad multi-byte strings, it just hides problems Autobuild-User: Andrew Tridgell <tridge@samba.org> Autobuild-Date: Thu Mar 24 01:47:26 CET 2011 on sn-devel-104
2011-03-23lib/util: Merge basic string length and comparison functionsAndrew Bartlett1-1/+1
These functions now use the codepoints for more accurate string handling and now form common code. Andrew Bartlett Autobuild-User: Andrew Bartlett <abartlet@samba.org> Autobuild-Date: Wed Mar 23 08:21:54 CET 2011 on sn-devel-104
2011-02-18lib/util/charset Add back setlocale(), but only when called from binariesAndrew Bartlett1-0/+1
When called from a library, we don't want to call this, as we may overwrite some of our calling program's context. Andrew Bartlett Autobuild-User: Andrew Bartlett <abartlet@samba.org> Autobuild-Date: Fri Feb 18 09:29:35 CET 2011 on sn-devel-104
2011-02-18lib/util/charcnv Move iconv handle setup in commonAndrew Bartlett1-0/+5
We now use the struct smb_iconv_convenience at the core of all our iconv code, and use global_iconv_convenience for the callers that don't specify one. Andrew Bartlett
2011-02-18lib/util/charset Use top level iconv.c in source3Andrew Bartlett1-3/+6
The two files were very similar already, the only change required was to adopt the s3 module registration fucntion name. (NTSTATUS wasn't used as the charset code does not otherwise use that type). Andrew Bartlett Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-02-18lib/util/charset add functions isupper_m and islower_mAndrew Bartlett1-0/+3
2010-11-03lib/util/charset/util_unistr: add strlen_m_ext_term() - variant of ↵Michael Adam1-0/+2
strlen_m_ext() counting terminator
2010-11-03lib/util/charset/util_unistr: add strlen_m_ext that takes input and output ↵Michael Adam1-0/+1
charset The function calculates the number of units (8 or 16-bit, depending on the destination charset), that would be needed to convert the input string which is expected to be in in src_charset encoding to the dst_charset (which should be a unicode charset).
2010-11-03lib/charcnv/util_unistr: add next_codepoint_ext() that accepts input charset.Michael Adam1-0/+2
next_codepoint() takes as string in CH_UNIX encoding and returns the unicode codepoint of the next (possibly multibyte) character of the input string. The new next_codepoint_ext() function adds the encoding of the input string as a parameter. next_codepoint() now only calls next_codepoint_ext() with CH_UNIX als src_charset argument.
2010-11-03lib/charset/charcnv: add next_codepoint_convenience_ext() that accepts input ↵Michael Adam1-0/+3
charset. next_codepoint_convenience() takes as string in CH_UNIX encoding and returns the unicode codepoint of the next (possibly multibyte) character of the input string. The new next_codepoint_convenience_ext() function adds the encoding of the input string as a parameter. next_codepoint_convenience() now only calls next_codepoint_convenience_ext() with CH_UNIX als src_charset argument.
2010-11-03util/charset: remove a duplicate comment.Michael Adam1-5/+0
This seems to have been copied twice from source3/ code.
2010-09-19s3: Fix the charset_pull routine (bug 7531)Volker Lendecke1-1/+1
In the push routine we do the SVAL, so we should do the SSVAL here.
2010-06-25Move UCS2 macros to common codeJelmer Vernooij1-0/+23
2010-03-18charset: fixed a problem with the global use of the iconv_convenience structureAndrew Tridgell1-4/+5
We had a crash bug where a cached copy of a iconv convenience pointer was used after being freed when loadparm asked for iconv to reload. This could happen if a python module used a iconv based function before loadparm was completed. The fix is to ensure that any use of this pointer remains valid, by reusing the pointer itself when it has already been initialised, but filling in the child elements with the updated values.
2009-04-23Add a new non-convenience version of push_codepoint.Jelmer Vernooij1-1/+2
2009-03-08Revert accidental reintroduction of void ** bug.Jelmer Vernooij1-3/+3
2009-03-01Use common header file for character set handling in Samba 3 and Samba 4.Jelmer Vernooij1-8/+103
2009-03-01s4: Use same function signature for convert_* as s3.Jelmer Vernooij1-6/+8
2009-03-01Sync smb_iconv_t type, convert_string return type with Samba 3 equivalents.Jelmer Vernooij1-1/+2
2009-03-01Add allow_badcharcnv argument to all conversion function, forJelmer Vernooij1-4/+4
consistency with Samba 3.
2009-01-16lib: add strlen_m_term_null from s3.Günther Deschner1-0/+1
Guenther
2008-11-01Remove convert_string_talloc_descriptor, add iconv_talloc().Jelmer Vernooij1-1/+5
2008-10-31finished adding UTF16_MUNGED charsetAndrew Tridgell1-2/+2
Changed the approach for the charset to go via utf16, which makes a bit more sense to read. Added a testsuiite for UTF16_MUNGED as part of LOCAL-ICONV
2008-10-24Remove more global_loadparm instances, fix syntax errors.Jelmer Vernooij1-1/+1
2008-10-24Add version of next_codepoint without iconv_convenience.Jelmer Vernooij1-1/+3
2008-10-24Remove dependency of charset code on loadparm.Jelmer Vernooij1-0/+1
2008-10-24Remove iconv_convenience argument from convert_string{,talloc}() butJelmer Vernooij1-2/+12
make them wrappers around convert_string{,talloc}_convenience().
2008-10-24Remove iconv_convenience parameter from simple string push/pullJelmer Vernooij1-17/+16
functions.
2008-10-24Split up codepoints code, use consistent _m suffix.Jelmer Vernooij1-5/+5
2008-10-24Rename string_replace_w to string_replace_m, which is more correct.Jelmer Vernooij1-1/+1
2008-10-24Move charset library to top level.Jelmer Vernooij1-0/+154