summaryrefslogtreecommitdiffstats
path: root/generic/tclEncoding.c
Commit message (Collapse)AuthorAgeFilesLines
* Some more internal use of size_t in stead of int. No functional change.jan.nijtmans2016-12-161-6/+2
|
* Use more "size_t" in stead of "int" internall. Also eliminate a lot of ↵jan.nijtmans2016-11-161-11/+11
| | | | type-casts which are not necessary any more.
* Fix [79614fb8b61983ac8ef30ea8752c310465798fc7|79614fb8b6]: "glob", "encoding ↵jan.nijtmans2016-11-111-1/+2
|\ | | | | | | system" and encoding-free filesystems
| * Fix [79614fb8b61983ac8ef30ea8752c310465798fc7|79614fb8b6]: "glob", "encoding ↵jan.nijtmans2016-11-111-1/+2
| |\ | | | | | | | | | system" and encoding-free filesystems
| | * Fix [79614fb8b61983ac8ef30ea8752c310465798fc7|79614fb8b6]: "glob", "encoding ↵jan.nijtmans2016-11-111-1/+2
| | | | | | | | | | | | system" and encoding-free filesystems
* | | Micro-optimization: Use TclGetStringFromObj in stead of Tcl_GetStringFromObj ↵jan.nijtmans2016-07-081-1/+1
| | | | | | | | | | | | in many places where possible.
* | | The DupEncodingIntRep() routine is broken. It fails to set the typePtrdgp2016-03-281-0/+1
|/ / | | | | | | | | | | | | | | | | field of the duplicated Tcl_Obj to indicate that the intrep is that of the &encodingType. The impact must be that refcounting of Tcl_Encodings are out of balance, at least in the (unusual?) case where "encoding" values need duplication. I hesitate to actually commit this fix until I have a test demonstrating the need for it, and a chance to see the impact on actual encoding operations. The lifetime management of encodings has a history of being tricky and raising controversy. More work required.
* | typo in comment. Eliminate unnecessary end-of-line spacing.jan.nijtmans2015-10-191-1/+1
| |
* | Some Unicode encoding fixes, only having effect if TCL_UTF_MAX > 4. ↵jan.nijtmans2015-08-311-2/+15
| | | | | | | | Backported from androwish
* | Fix UtfToUtfProc() to remove the potential to read beyond end of input buffer.dgp2015-04-241-1/+1
|\ \ | |/
| * Fix UtfToUtfProc() to remove the potential to read beyond end of input buffer.dgp2015-04-241-1/+1
| |
* | Support TCL_ENCODING_CHAR_LIMIT in TableToUtfProc and EscapeToUtfProc drivers.dgp_encoding_flagsdgp2014-12-231-4/+10
| |
* | Support TCL_ENCODING_CHAR_LIMIT in the Iso88591ToUtfProc driver.dgp2014-12-231-2/+5
| |
* | Support TCL_ENCODING_CHAR_LIMIT in the UnicodeToUtfProc driver.dgp2014-12-231-2/+5
| |
* | Support TCL_ENCODING_CHAR_LIMIT in the UtfToUtfProc driver.dgp2014-12-231-2/+5
| |
* | Support TCL_ENCODING_CHAR_LIMIT in the BinaryProc driver.dgp2014-12-231-0/+3
| |
* | merge trunkdgp2014-12-231-3/+9
|\ \
| * | Revise encoding finalization so that it does a more complete job of restoringdgp2014-12-171-3/+9
| | | | | | | | | | | | the pre-initialized state. This makes finalization errors more repeatable and cross-platform.
* | | Add to Tcl_ExternalToUtf() a capability to impose a limit on the numberdgp2014-11-151-4/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | of chars produce in the encoding result. When the flag TCL_ENCODING_CHAR_LIMIT is set and dstCharsPtr is not NULL, then the initial value of *dstCharsPtr is taken as the max number of chars to produce. The limit is imposed in a way that does not require the assistance of the encoding's driver procs, but the flag is passed on to them in case they can do better when they know they should. No callers updated yet. No drivers updated yet. One difficulty is that this necessarily imposes a pre-translation limit, and the I/O system has a history of wanting to impose only a post-translation limit.
* | | Tcl_ExternalToUtf appends a terminating NUL to its encoded results.dgp2014-11-151-7/+15
|/ / | | | | | | | | | | | | Perhaps this is a welcome convenience for some callers, but not for Tcl's I/O system, which has no need for that. Added a new flag value TCL_ENCODING_NO_TERMINATE that callers can use to suppress this behavior. This means buffers don't require so much padding, and a tiny bit of processing is saved. Update I/O callers to use the feature.
* | Simplify the core output operations of channels. Reduce duplicative and dead ↵dgp2014-02-041-1/+3
|\ \ | |/ | | | | code.
| * Be sure to finalize the identity encoding.dgp_optimize_output_stagedgp2014-02-041-0/+1
| |
| * Refactor WriteChars() and WriteBytes() into simple wrappers of a commondgp2014-01-301-0/+2
| | | | | | routine Write().
* | Unbreak msvc builds, by depending on tclPort.h for inclusion of <sys/stat.h>jan.nijtmans2013-02-101-1/+0
|\ \ | |/
| * Unbreak msvc builds, by depending on tclPort.h for inclusion of <sys/stat.h>.jan.nijtmans2013-02-101-1/+0
| |
* | merge core-8-5-branchjan.nijtmans2013-01-311-4/+4
|\ \ | |/
| * Use twoPtrValue.ptr1 in stead of otherValuePtr everywhere. This is exactly ↵jan.nijtmans2013-01-311-4/+4
| | | | | | | | the same field, but it allows twoPtrValue.ptr2 to be used for other purposes.
* | revert [8abba84224], and make sure that every source file that uses ↵jan.nijtmans2013-01-171-0/+1
|\ \ | |/ | | | | Tcl_StatBuf has an "#include <sys/stat.h>" before including tcl.h
| * revert [8abba84224], and make sure that every source file that uses ↵jan.nijtmans2013-01-171-0/+1
| | | | | | | | Tcl_StatBuf has an "#include <sys/stat.h>" before including tcl.h
| * make some more internal tables constjan.nijtmans2012-04-181-59/+59
| |\ | | | | | | a few CONST -> const changes
| | * make some more internal tables CONSTjan.nijtmans2012-04-181-1/+1
| | | | | | | | | fix compilation with -DNO_CONST
* | | more result generation conversiondkf2012-08-031-2/+4
| | |
* | | Factor out a number of common patterns of use of Tcl_DStringAppend.dkf2012-07-031-2/+2
| | |
* | | [Bug 3466099] BOM in Unicodejan.nijtmans2012-02-291-2/+2
|\ \ \ | |/ /
| * | [Bug 3466099] BOM in Unicodejan.nijtmans2012-02-291-2/+2
| |\ \ | | |/
| | * [Bug 3466099] BOM in Unicodejan.nijtmans2012-02-191-2/+2
| | |
| * | Backport fix for [Bug 2857044].dgp2011-04-271-0/+1
| | |
* | | Adjust ckalloc/ckfree macros to greatly reduce number of explicit casts indkf2011-03-121-17/+17
| | | | | | | | | rest of Tcl source code. No ABI change. API change *should* be harmless.
* | | Now that we're no longer using SCM based on RCS, the RCS Keyword linesdgp2011-03-021-2/+0
|\ \ \ | |/ / | | | cause more harm than good. Purged them (except in zlib files).
| * | Now that we're no longer using SCM based on RCS, the RCS Keyword lines causedgp2011-03-021-2/+0
| |\ \ | | |/ | | | more harm than good. Purged them.
| | * Now that we're no longer using SCM based on RCS, the RCS Keyword lines causedgp2011-03-011-2/+0
| | | | | | | | | more harm than good. Purged them.
| | * (Backport) Fix [Bug 2891556] and improve test to detect similar ↵ferrieux2009-11-161-6/+22
| | | | | | | | | | | | manifestations in the future.
| | * UtfToUtfProc: Avoid unwanted sign extension when converting incomplete UTF-8jenglish2008-07-041-3/+3
| | | | | | | | | | | | sequences. See [Bug 1908443] for details.
| | * * generic/tclEncoding.c (EscapeFromUtfProc): Applied patchandreas_kupries2007-02-121-3/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | supplied by Mo DeJong to fix [Bug 1516109]. Backport from Tcl 8.5. Mo's description: Clear the TCL_ENCODING_END flag when end bytes are written. This fix keep this method from writing escape bytes for an encoding like iso2022-jp multiple times when the escape byte overlap with the end of the IO buffer. * tests/io.test: Add test case for escape byte overlap case.
| | * (UnicodeToUtfProc): dst must be set to (ch & 0xFF) to work on big endian systemshobbs2006-10-061-2/+2
| | |
| | * * generic/tcl.h: note limitation on changing Tcl_UniChar sizehobbs2006-10-051-24/+35
| | | | | | | | | | | | | | | | | | * generic/tclEncoding.c (UtfToUnicodeProc, UnicodeToUtfProc): * tests/encoding.test (encoding-16.1): fix alignment issues in unicode <> utf conversion procs. [Bug 1122671]
| | * * generic/tclEncoding.c: Replace buffer copy in for loopdgp2006-08-091-4/+2
| | | | | | | | | | | | with call to memcpy(). Thanks to afredd. [Patch 1530262]
| | * * generic/tclIO.c (ReadChars): Added check and panic andandreas_kupries2006-04-051-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commentary to a piece of code which relies on BUFFER_PADDING to create enough space at the beginning of each buffer forthe insertion of partial multi-byte data at the beginning of a buffer. To explain why this code is ok, and as precaution if someone twiddled the BUFFER_PADDING into uselessness. * generic/tclIO.c (ReadChars): [SF Tcl Bug 1462248]. Added code temporarily suppress the use of TCL_ENCODING_END set when eof was reached while the buffer we are converting is not truly the last buffer in the queue. together with the Utf bug below it was possible to completely bollox the buffer data structures, eventually crashing Tcl. * generic/tclEncoding.c (UtfToUtfProc): Fixed problem where the function accessed memory beyond the end of the input buffer. When TCL_ENCODING_END is set and the last bytes of the buffer start a multi-byte sequence. This bug contributed to [SF Tcl Bug 1462248].
| | * * generic/tclEncoding.c: Report error when an escape encodingdgp2006-03-131-5/+24
| | | | | | | | | | | | is missing one of its sub-encodings [Bug 506653].
| | * * generic/tclIOUtil.c (TclFSNormalizeAbsolutePath): make statichobbs2005-10-051-4/+4
| | | | | | | | | | | | * generic/tclEncoding.c (TclFindEncodings): make static