Commit Graph
49 Commits
Author SHA1 Message Date
Atsushi Eno f4071fef2b 2007-10-25 Atsushi Enomoto <[email protected]>
* DecoderReplacementFallbackBuffer.cs : Reset() should also reset the
	  input buffer. When fallback is not assigned, just return '\0'.
	* UnicodeEncoding.cs : handle throwOnInvalid .ctor argument.
	  Default replacement fallback buffer is now "\uFFFD".
	* UTF8Encoding.cs : couple of replacement buffer size fixes.
	  Default replacement fallback buffer is now "\uFFFD".
	* UTF32Encoding.cs : Default replacement is "\uFFFD" too here.
	  See http://support.microsoft.com/kb/940521/ for this change.

	* UnicodeEncodingTest.cs,
	  UTF8EncodingTest.cs,
	  DecoderReplacementFallbackBufferTest.cs,
	  DecoderReplacementFallbackTest.cs : default replacement buffer fix.
	  Added test for Reset() for replacement buffer.


svn path=/trunk/mcs/; revision=88150
2007-10-25 09:42:03 +00:00
Gert Driesen 797ad860d5 * UTF8Encoding.cs: IsMailNewsSave should return true. Fixes bug
#332515.
* UTF32Encoding.cs: IsBrowserSave returns false for both Big-Endian and
Little-Endian.
* TestEncoding.cs: Also make class available on 1.0 profile.
* EncodingTest.cs: Added tests for Is* properties.
* UTF7EncodingTest.cs: Added tests for Is* properties.
* UnicodeEncodingTest.cs: Added tests for Is* properties. Fixed 
line endings.
* UTF8EncodingTest.cs: Added tests for Is* properties. Spaces to
tabs. Numbered tests.
* ASCIIEncodingTest.cs: Added tests for Is* properties. No longer
derive from TestCase class. Spaces to tabs.    
* UTF32EncodingTest.cs: Added tests for Is* properties. No longer
derive from deprecated Assertion class.

svn path=/trunk/mcs/; revision=87593
2007-10-16 14:48:47 +00:00
Miguel de Icaza 8a1af5fd38 2006-11-16 Miguel de Icaza <[email protected]>
* DirectoryInfo.cs (GetFiles): Implement option with SearchOptions
	== AllDirectories

And a lot of MonoTODOs updated as well


svn path=/trunk/mcs/; revision=67998
2006-11-16 14:14:01 +00:00
Gert Driesen b136e2077e * ASCIIEncoding.cs: Marked class ComVisible (true) on 2.0 profile.
Marked 2.0-only members as ComVisible (false).
* Decoder.cs: Marked class ComVisible (true) on 2.0 profile. Marked
2.0-only members as ComVisible (false).
* Encoder.cs: Marked class ComVisible (true) on 2.0 profile. Marked
2.0-only members as ComVisible (false).
* Encoding.cs: Marked class ComVisible (true) on 2.0 profile. Marked
2.0-only members as ComVisible (false).
* NormalizationForm.cs: Marked ComVisible (true).
* StringBuilder.cs: Marked class ComVisible (true) on 2.0 profile.
Marked 2.0-only methods as ComVisible (false).
* UnicodeEncoding.cs: GetString (byte[], int, int) is only available
in 2.0 profile. Marked 2.0-only methods ComVisible (false). Added
missing ctor in 2.0 profile, and marked in MonoTODO.
* UTF7Encoding.cs: Marked class ComVisible (true) on 2.0 profile.
* UTF8Encoding.cs: Marked 2.0-only methods as ComVisible (false).

svn path=/trunk/mcs/; revision=61250
2006-05-30 09:02:37 +00:00
Atsushi Eno abcea4f6f0 2006-03-24 Atsushi Enomoto <[email protected]>
* UTF8Encoding.cs : made internal implementation as pointer-based,
	  and added pointer-based converter method overloads.


svn path=/trunk/mcs/; revision=58408
2006-03-24 11:20:24 +00:00
Atsushi Eno ce4d8a502d 2006-02-14 Atsushi Enomoto <[email protected]>
* UTF8Encoding.cs : Fallback was indicating incorrect index.
	  Fixed bug #77550.

	* UTF8EncodingTest.cs : test for bug #77550.


svn path=/trunk/mcs/; revision=56848
2006-02-14 10:31:51 +00:00
Atsushi Eno d6d80fd7c1 2006-02-03 Atsushi Enomoto <[email protected]>
* UTF8Encoding.cs : avoid possible overflow.


svn path=/trunk/mcs/; revision=56535
2006-02-03 17:05:10 +00:00
Atsushi Eno e85a1fe77c 2006-02-03 Atsushi Enomoto <[email protected]>
* UTF8Encoding.cs : In zero-charbuffer case, byte buffer count should
	  be checked. Also it should not ignore leftOver characters even if
	  byte buffer length is 0.

	* UTF8EncodingTest.cs : added test for insufficient bytes for
	  flush=true and leftOver!='\0' case.


svn path=/trunk/mcs/; revision=56533
2006-02-03 16:54:56 +00:00
Atsushi Eno 1d4633d57d 2006-02-03 Atsushi Enomoto <[email protected]>
* UTF8Encoding.cs : Fast path optimization for InternalGetByteCount()
	  and InternalGetBytes().


svn path=/trunk/mcs/; revision=56518
2006-02-03 11:59:07 +00:00
Atsushi Eno 90f44f360a 2006-02-02 Atsushi Enomoto <[email protected]>
* UTF8Encoding.cs :
	  actually leftover bits needs more careful handleding. So it's
	  better to be rather close to the original GetBytes().
	  Also changed leftOver handling so that it will be able to support
	  fallback.


svn path=/trunk/mcs/; revision=56516
2006-02-03 10:37:42 +00:00
Atsushi Eno c9bb7c1bc1 2006-02-02 Atsushi Enomoto <[email protected]>
* UTF8Encoding.cs :
	  GetBytes(string, ...) could reuse InternalGetBytes() using fixed
	  pointers. However, InternalGetBytes() was slower than
	  GetBytes(string, ...), so first replaced existing InternalGetBytes()
	  with GetBytes() internals, and GetBytes(string, ...) switched to 
	  InternalGetBytes(). Now GetBytes() implementation code is reduced
	  to one method.


svn path=/trunk/mcs/; revision=56509
2006-02-03 07:55:02 +00:00
Atsushi Eno da8fc189ae 2006-02-02 Atsushi Enomoto <[email protected]>
* UTF8Encoding.cs : fast path optimization was pretty insufficient.
	  Now it handles the entire bytes, not just half of them.


svn path=/trunk/mcs/; revision=56449
2006-02-02 11:16:33 +00:00
Atsushi Eno 8d3b321d8c 2006-02-02 Atsushi Enomoto <[email protected]>
* UTF8Encoding.cs : zero-length check was wrong. Check it by
	  "charIndex == chars.Length" instead of "charCount == 0".


svn path=/trunk/mcs/; revision=56448
2006-02-02 11:01:21 +00:00
Atsushi Eno eac1005552 2006-02-02 Atsushi Enomoto <[email protected]>
* UTF8Encoding.cs : switched GetBytes() to pointer-based code.
	  Implemented 2.0 pointer-based GetBytes(). 10% perf. improvement.


svn path=/trunk/mcs/; revision=56447
2006-02-02 10:54:24 +00:00
Atsushi Eno 5ccd6179af 2006-01-30 Atsushi Enomoto <[email protected]>
* UTF8Encoding.cs : InternalGetCharCount() optimization again, and
	  this time InternalGetChars() as well.


svn path=/trunk/mcs/; revision=56251
2006-01-30 14:29:56 +00:00
Atsushi Eno c24aec4964 2006-01-24 Atsushi Enomoto <[email protected]>
* UTF8Encoding.cs : reverted the previous change. Looks like it broke
	  the build.


svn path=/trunk/mcs/; revision=55989
2006-01-24 16:04:06 +00:00
Atsushi Eno 66f3bd751c 2006-01-24 Atsushi Enomoto <[email protected]>
* UTF8Encoding.cs : InternalGetCharCount() optimization: fast path
	  for ASCII range.


svn path=/trunk/mcs/; revision=55981
2006-01-24 13:49:01 +00:00
Atsushi Eno fb852c038d 2006-01-24 Atsushi Enomoto <[email protected]>
* UTF7Encoding.cs UTF8Encoding.cs :
	  Fixed bug #77315 (Patch by [email protected]).
	  Make strict check for invalid surrogate.

	* UTF7EncodingTest.cs : added test for bug #77315.
	* UTF8EncodingTest.cs : added test for bug #77315. Also, now a
	  bunch of tests are working (while they are marked as NotDotNet
	  under 1.1 profile).


svn path=/trunk/mcs/; revision=55971
2006-01-24 07:53:12 +00:00
Atsushi Eno a64ccb6ec1 2005-12-08 Atsushi Enomoto <[email protected]>
* UTF8Encoding.cs : (GetChars) let ABCREM work effectively.


svn path=/trunk/mcs/; revision=54111
2005-12-08 12:51:32 +00:00
Atsushi Eno 2a67cdf5a9 2005-12-08 Atsushi Enomoto <[email protected]>
* Encoding.cs : now under 2.0 GetBytes(string,...) dispatches to
	  byte*-based GetBytes().
	* UTF8Encoding.cs : avoid extraneous DecoderFallbackBuffer creation
	  which came to happen after introducing fallback buffer.


svn path=/trunk/mcs/; revision=54109
2005-12-08 11:59:32 +00:00
Atsushi Eno caeaed1076 2005-11-22 Atsushi Enomoto <[email protected]>
* ASCIIEncoding.cs, Latin1Encoding.cs : added EncoderFallback support.
	* Encoding.cs : changed default fallback selection. Seems like only
	  ASCII and GB18030 uses '?' for replacement.
	* UTF8Encoding.cs : now that Fallback is read only by default, we
	  need special setter.

	* EncoderReplacementFallbackTest.cs :
	  Added Latin1 replacement test.
	  Updated some test results changed from beta2 to RTM.
	* DecoderReplacementFallbackTest.cs : the same updates.


svn path=/trunk/mcs/; revision=53350
2005-11-22 17:19:45 +00:00
Atsushi Eno 46247b635b 2005-11-16 Atsushi Enomoto <[email protected]>
* UTF8Encoding.cs : safer UTF8Decoder ctor.


svn path=/trunk/mcs/; revision=53140
2005-11-16 18:56:56 +00:00
Atsushi Eno e14f1bcad3 2005-11-16 Atsushi Enomoto <[email protected]>
* Decoder.cs : added FallbackBuffer property.
	* UTF8Encoding.cs : In NET_2_0, use DecoderFallbackBuffer instead of
	  "throwOnInvalid".

	* UTF8EncodingTest.cs : Simply replaced all ArgumentException with
	  switched alias (it is DecodefFallbackException in NET_2_0).


svn path=/trunk/mcs/; revision=53137
2005-11-16 18:37:52 +00:00
Jonathan Pryor e953a03eb9 * UTF8Encoding.cs (InternalGetChars/InternalGetCharCount): Fix lead byte
check logic for 6 octet sequences.  ((ch & 0xFC) == 0xFC) is always true 
	  for 0xFF, even though 0xFF isn't a valid lead byte.  It should be 
	  ((ch & 0xFE) == 0xFC).

svn path=/trunk/mcs/; revision=52064
2005-10-22 18:08:48 +00:00
Atsushi Eno 8b1efba385 2005-08-25 Atsushi Enomoto <[email protected]>
in mcs:
	* driver.cs : Use default encoding on the environment.
	  Removed (now that) extra parameter for SeekableStreamReader.
	* support.cs : (SeekableStreamReader) third .ctor() argument for
	  StreamReader is not required (always true). preamble size could
	  be acquired in simpler and safe way.

in tests:
	* test-444.cs :
	  UTF-8 BOM autodetect test (for encoding detection patch).

in class/corlib/System.Text:
	* UTF8Encoding.cs : (InternalGetChars/InternalGetCharCount):
	  Don't exclude FEFF in the resulting text.

in class/corlib/Test/System.Text:
	* UTF8EncodingTest.cs : added GetCharsFEFF().

in class/Managed.Windows.Forms:
	* Makefile : added /codepage:65001 (otherwise the build gets broken
	  on KeyboardLayout.cs on some non-iso-8859-1 environment).


svn path=/trunk/mcs/; revision=48826
2005-08-25 10:41:47 +00:00
Raja R Harinath e0cfa4925e Set svn:eol-style=native, delete svn:executable.
Fix line endings of System/Decimal.cs (only actual "change" in text, to force recompile of mscorlib to reflect changes in decimal constant handling in the compiler)


svn path=/trunk/mcs/; revision=44558
2005-05-16 12:23:26 +00:00
Miguel de Icaza a8dea00dfb Fixed licenses
svn path=/trunk/mcs/; revision=30382
2004-06-25 14:42:22 +00:00
Gert Driesen b447caed96 * ASCIIEncoding.cs: added TODO for serialization
* StringBuilder.cs: added TODO for serialization
* UnicodeEncoding.cs: added TODO for serialization
* UTF7Encoding.cs: added TODO for serialization
* UTF8Encoding.cs: added TODO for serialization

svn path=/trunk/mcs/; revision=29621
2004-06-15 17:53:18 +00:00
Duncan Mak 13d1764537 Add license and copyright to all source files in corlib
svn path=/trunk/mcs/; revision=29249
2004-06-11 02:09:36 +00:00
Atsushi Eno 057b5cc83b 2004-06-07 Atsushi Enomoto <[email protected]>
* UTF8Encoding.cs : Length check must be done only when the character
	  sequence is valid (i.e. should not check when it is overlongs).
	  See also TestThrowOnInvalid().

svn path=/trunk/mcs/; revision=28980
2004-06-07 17:54:23 +00:00
Atsushi Eno 365aff1294 2004-06-07 Atsushi Enomoto <[email protected]>
* UTF8Encoding.cs : Added Overlong check to InternalGetCharCount().

svn path=/trunk/mcs/; revision=28975
2004-06-07 17:35:49 +00:00
Atsushi Eno b01c7bf7e6 2004-06-07 Atsushi Enomoto <[email protected]>
* UTF8Encoding.cs : Throw overlongs error only when throwOnInvalid is
	  true. Otherwise just ignore them.

svn path=/trunk/mcs/; revision=28966
2004-06-07 14:25:30 +00:00
Sebastien Pouliot b2744fd13e 2004-05-14 Sebastien Pouliot <[email protected]>
* UTF8Encoding.cs: Added code to check for overlongs.

svn path=/trunk/mcs/; revision=27419
2004-05-14 17:41:31 +00:00
Sebastien Pouliot 24a73cab4c 2004-05-14 Sebastien Pouliot <[email protected]>
* UTF8Encoding.cs: Moved charCount-- after the check for surrogate
	pair. This fix bug #57009 (and 2 failing unit tests).

svn path=/trunk/mcs/; revision=27405
2004-05-14 13:36:37 +00:00
Ben Maurer a0cc03b77c 2003-12-07 Ben Maurer <[email protected]>
* UTF8Encoding.cs (GetBytes string): Do not call base
	The version in Encoding will call string.ToCharArray (),
	allocating an extra array. By calling the better method
	in our own class we can save memory.

svn path=/trunk/mcs/; revision=20846
2003-12-08 01:38:15 +00:00
Miguel de Icaza 3d0638b95e 2003-11-11 Miguel de Icaza <[email protected]>
* Encoding.cs: Use an internal variable to track the parameters of
	each encoder, since the .NET API does not expose virtual methods
	in the child classes, we should not depend on that.

	* ASCIIEncoding.cs, UTF7Encoding, UTF8Encoding, UnicodeEncoding:
	Initialize the parameters for base class encoding here.

svn path=/trunk/mcs/; revision=19843
2003-11-11 22:54:18 +00:00
Nick Drochak fc97537458 2003-06-05 Nick Drochak <[email protected]>
* UTF8Encoding.cs: Cleanups according to class status page

svn path=/trunk/mcs/; revision=15126
2003-06-05 14:41:13 +00:00
Paolo Molaro 4be3ca2233 Tue Nov 19 13:03:27 CET 2002 Paolo Molaro <[email protected]>
* UTF8Encoding.cs: fix GetByteCount (), too.

svn path=/trunk/mcs/; revision=9070
2002-11-19 12:07:19 +00:00
Miguel de Icaza 0fcd47a575 2002-11-19 Miguel de Icaza <[email protected]>
* UnicodeEncoding.cs: the bytemark should only be used to return
	information in GetPreamble, not to actually encode the information
	on the stream.  That is taken care of by the Stream classes.

	* UTF8Encoding.cs: ditto.

svn path=/trunk/mcs/; revision=9068
2002-11-19 11:18:36 +00:00
Miguel de Icaza 2eefff50b3 2002-09-06 Miguel de Icaza <[email protected]>
* Console.cs: Specify an encoder, otherwise we will get the UTF8
	encoder that by default emits the byte markers.

2002-09-06  Miguel de Icaza  <[email protected]>

	* StreamReader.cs: Implement detection of byte marks and skipping
	of byte marks at the beginning of the stream.

	(ReadToEnd): Use buffered read instead of char-by-char
	processing.

	Correct the default arguments for creating the StreamReader.

2002-09-06  Miguel de Icaza  <[email protected]>

	* Encoding.cs (UTF8, Unicode): Create with a preamble, that is
	what the Microsoft version does.

	(UnixConsoleEncoding): New internal method, used to get the
	encoding, in the future, this should pull the locale, map to
	charset and then code page.

svn path=/trunk/mcs/; revision=7295
2002-09-06 23:57:02 +00:00
Paolo Molaro 6c10f94827 Mon Aug 26 16:44:54 CEST 2002 Paolo Molaro <[email protected]>
* *.cs: change to conform to mono coding style.

svn path=/trunk/mcs/; revision=7050
2002-08-26 14:46:37 +00:00
Gonzalo Paniagua Javier 851bbb86ad 2002-08-24 Gonzalo Paniagua Javier <[email protected]>
* ASCIIEncoding.cs:
	* Decoder.cs:
	* Encoder.cs:
	* Encoding.cs:
	* UTF7Encoding.cs:
	* UTF8Encoding.cs:
	* UnicodeEncoding.cs: added Serializable attribute.

svn path=/trunk/mcs/; revision=7001
2002-08-24 17:49:22 +00:00
Paolo Molaro feee3a2d52 Wed Aug 21 20:02:04 CEST 2002 Paolo Molaro <[email protected]>
* *.cs: imported the code donated by Rhys Weatherley
	<[email protected]>.

svn path=/trunk/mcs/; revision=6863
2002-08-21 18:04:52 +00:00
Piers Haken 610d7923ac added missing [Serializable] attribute
svn path=/trunk/mcs/; revision=3540
2002-04-01 20:22:40 +00:00
Dietmar Maurer 12d3d0ce8c unicode support (using iconv)
svn path=/trunk/mcs/; revision=1801
2002-01-04 06:32:08 +00:00
Miguel de Icaza 61634984c6 Some warning reduction:
2001-10-07  Miguel de Icaza  <[email protected]>

	* Exception.cs: Implement bits of serialization.

	* RuntimeFieldHandle.cs: Implement Serialization features.

	* Type.cs: Implement TypeHandle property.

2001-10-07  Miguel de Icaza  <[email protected]>

	* AssemblyBuilder.cs: Reformatted.

	Added override keywords to those that needed them.

	Removed methods that we do not override, but just inherit

2001-10-07  Miguel de Icaza  <[email protected]>

	* Encoding.cs, UTF8Encoding.cs, UTF7Encoding.cs, ASCIIEncoding.cs,
	UnicodeEncoding.cs: Corrected API.

	* UTF8Encoding.cs: Checked in changes from Rafael.

svn path=/trunk/mcs/; revision=1113
2001-10-07 01:39:01 +00:00
Miguel de Icaza b958209366 Added updated UTF8Encoding from Rafael
svn path=/trunk/mcs/; revision=1111
2001-10-07 00:36:47 +00:00
Dietmar Maurer 9de03899f8 2001-08-28 Dietmar Maurer <[email protected]>
* Console.cs: impl. (write only)

	* Int32.cs: impl. real op_Equal

	* UTF8Encoding.cs: impl. clumsy GetBytes

	* StreamWriter.cs: impl.

	* TextWriter.cs: implemented Write and WriteLine methods

svn path=/trunk/mcs/; revision=654
2001-08-28 10:37:08 +00:00
Sean MacIsaac 6b52f46149 * UnicodeEncoding.cs: Members added so that a clean compile is
possible.

* ASCIIEncoding.cs: Members added so that a clean compile is
possible.

* UTF7Encoding.cs: Members added so that a clean compile is
possible.

* UTF8Encoding.cs: Members added so that a clean compile is
possible.

* Encoding.cs: All public members included.  Most members
unimplemented.

svn path=/trunk/mcs/; revision=35
2001-06-26 14:19:40 +00:00