Commit Graph
92 Commits
Author SHA1 Message Date
Marcos Henrich 631f3685bb Added classes EncodingEncoder and EncodingDecoder.
EncodingEncoder and EncodingDecoder override Encoder.Convert.
The Convert overrides allow retrieval of chars/bytes buffers with the same size as .NET.
2014-08-07 09:28:44 +01:00
Atsushi Eno 132a16ca07 Revert "Merge pull request #622 from killabytenow/master"
This reverts commit 392bae3c45, reversing
changes made to 61cd9ee8b6.
2013-07-13 23:56:59 +09:00
Gerardo García Peña c22ce0e053 Reverted all changes in 'System.Text/Encoding.cs' and disabled the emitIdentifier feature in the new 'System.Text/UTF8Encoding.cs'. 2013-05-23 15:43:27 +02:00
Gerardo García Peña ade6a99d9e By default return an 'UTF8Unmarked' object. Removed unused 'utf8EncodingWithMarkers' attribute. 2013-05-23 12:53:15 +02:00
Gerardo García Peña c9e3b37bb8 Disable BOM preamble in UTF8 by default (following best practices). 2013-04-29 08:09:23 +02:00
Rodrigo Kumpera b96d05dac3 Kill the MOONLIGHT define in corlib. 2013-02-11 16:03:28 -05:00
Atsushi Eno c1fe3fb643 fix mobile build. 2013-01-29 18:25:09 +09:00
Miguel de Icaza 505a1e2bae [mscorlib/mobile] Encoding.Default is always UTF8 in mobile, strip out all the code that brings the encoding system 2013-01-28 20:48:59 -05:00
Marek Safar 7883a2dafd Clean up some static initializers 2012-10-03 12:19:55 +01:00
Marek Safar c45375b4c8 Fix types signature 2012-07-27 12:25:43 +01:00
Marek Safar f6edbba2d1 Cache empty byte arrays 2012-06-22 18:55:51 +01:00
Andrius Bentkus 64a8bec6a5 Fix upper case encoding constants.
name.ToLowerInvariant ().Replace ('-', '_') should ensure that they
are all lowercase.
2011-07-08 06:35:38 +02:00
Rodrigo Kumpera d72794cced Reorder fields to improve object layout since the runtime can't do it for corlib types. 2011-05-23 01:13:09 -03:00
Marek Safar 145d6be351 Avoid linear scan in GetEncoding and make the initialization lazy 2011-01-26 13:29:11 +00:00
Jb Evain e73cf2586e use MOONLIGHT symbol
svn path=/trunk/mcs/; revision=153659
2010-03-16 12:13:57 +00:00
Chris Toshok 098cdab4f3 2009-12-09 Chris Toshok <[email protected]>
* Encoding.cs (get_Default): moonlight defaults to UTF8, not
	UTF8Unmarked.


svn path=/trunk/mcs/; revision=148148
2009-12-11 20:38:39 +00:00
Geoff Norton b281dc05de restore iso-8859-1 to monotouch
svn path=/trunk/mcs/; revision=145882
2009-11-10 20:54:22 +00:00
Miguel de Icaza 53d746c7a1 2009-11-02 Miguel de Icaza <[email protected]>
* Jumbo patch to drop support for pre-NET_2_0 code:

        Remove NET_2_0 defines assuming the value is true.


svn path=/trunk/mcs/; revision=145232
2009-11-03 00:27:28 +00:00
Sebastien Pouliot 74870bf3c6 2009-10-06 Sebastien Pouliot <[email protected]>
* Encoding.cs: Remove normalization methods for Moonlight


svn path=/trunk/mcs/; revision=143536
2009-10-06 17:15:32 +00:00
Sebastien Pouliot 4cfb97dff5 fix smcs with utf32 encoded files
svn path=/trunk/mcs/; revision=142544
2009-09-24 01:19:05 +00:00
Sebastien Pouliot ba83238a54 2009-09-22 Sebastien Pouliot <[email protected]>
* Encoding.cs: Remove UTF32, Latin1 and custom (loaded code)
	encodings for NET_2_1


svn path=/trunk/mcs/; revision=142397
2009-09-22 13:34:24 +00:00
Jb Evain 37111e4f26 in System.Text:
2009-01-13  Jb Evain  <[email protected]>

	* Encoding.cs: when creating a ForwardingEncoder or a
	ForwardingDecoder, don't crash if the Encoding doesn't
	provide an EncoderFallback or a DecoderFallback.

in Test/System.Text:
2009-01-13  Jb Evain  <[email protected]>

	* EncoderTest.cs: Make sure we can get an encoder for a custom
	encoding.
	* DecoderTest.cs: ditto.

svn path=/trunk/mcs/; revision=123196
2009-01-13 15:25:45 +00:00
Marek Safar cc9c53a109 Warnings cleanup
svn path=/trunk/mcs/; revision=111713
2008-08-27 15:40:13 +00:00
Andreas N 5122e976a5 2008-07-03 Andreas Nahr <[email protected]>
* UTF8Encoding.cs:
	* UTF7Encoding.cs:
	* UTF32Encoding.cs:
	* EncodingInfo.cs:
	* Encoding.cs:
	* Encoder.cs:
	* ASCIIEncoding.cs: Fix parameter names

svn path=/trunk/mcs/; revision=107125
2008-07-02 23:55:44 +00:00
Kornél Pál 426dfad3f8 Fix previous commit
svn path=/trunk/mcs/; revision=99106
2008-03-27 10:08:12 +00:00
Kornél Pál 895c02b7dd Encoding.cs: Fix possible integer overflow in argument validation.
svn path=/trunk/mcs/; revision=99097
2008-03-27 08:44:58 +00:00
Atsushi Eno 646393c59c 2007-12-27 Atsushi Enomoto <[email protected]>
* DecoderFallback.cs, EncoderFallback.cs, Encoding.cs :
	  the same "\uFFFD" fix for encoder fallback.
	  Reduced extra instantiation of those fallbacks.

	* EncoderReplacementFallbackTest.cs,
	  EncoderReplacementFallbackBufferTest.cs : encoder test for
	  "\uFFFD" replacement.


svn path=/trunk/mcs/; revision=91947
2007-12-27 16:04:57 +00:00
Atsushi Eno 383cb727e2 2007-10-27 Atsushi Enomoto <[email protected]>
* Encoding.cs : fixed UTF8UnmarkedUnsafe for 1.1; should not be null.


svn path=/trunk/mcs/; revision=88297
2007-10-27 03:07:15 +00:00
Atsushi Eno 4089f586b1 2007-10-26 Atsushi Enomoto <[email protected]>
* Encoding.cs : added UTF8UnmarkedUnsafe, for old empty replacement
	  UTF8.

	* BinaryReader.cs, BinaryWriter.cs : use unsafe encoding that has ""
	  for replacement fallback. Binary serialization regression is fixed.


svn path=/trunk/mcs/; revision=88276
2007-10-26 17:27:23 +00:00
Dick Porter ed0e0a5242 2007-05-03 Dick Porter <[email protected]>
* ProxyAttribute.cs: 
	* RealProxy.cs: Update to 2.0 profile

2007-05-03  Dick Porter  <[email protected]>

	* ITrackingHandler.cs: 
	* EnterpriseServicesHelper.cs: 
	* TrackingServices.cs: Update to 2.0 profile

2007-05-03  Dick Porter  <[email protected]>

	* IFieldInfo.cs: 
	* ISoapMessage.cs: 
	* InternalRM.cs: 
	* InternalST.cs: 
	* ServerFault.cs: 
	* SoapFault.cs: 
	* SoapMessage.cs: 
	* FormatterAssemblyStyle.cs: 
	* FormatterTypeStyle.cs: 
	* TypeFilterLevel.cs: Update to 2.0 profile

2007-05-03  Dick Porter  <[email protected]>

	* BinaryFormatter.cs: Update to 2.0 profile

2007-05-03  Dick Porter  <[email protected]>

	* Encoding.cs: 
	* UnicodeEncoding.cs: 
	* UTF7Encoding.cs: Update to 2.0 profile



svn path=/trunk/mcs/; revision=76625
2007-05-03 16:21:18 +00:00
Miguel de Icaza c6e197166f Add support for detecting UTF32 and UTF-32 bigendian
patch from  Peter Dettman ([email protected])


svn path=/trunk/mcs/; revision=73779
2007-03-06 04:26:50 +00:00
Gert Driesen 5aa45b37f3 * Encoding.cs: Enabled ArgumentException in GetEncoding (string) again.
In Encoding.Default, catch both ArgumentException and NotSupportException.
* EncodingTest.cs: Enabled test again.

svn path=/trunk/mcs/; revision=72130
2007-02-01 20:06:07 +00:00
Atsushi Eno bb68bac1cb 2007-02-01 Atsushi Enomoto <[email protected]>
* Encoding.cs : the change broke the build, so reverted part of it.

	* EncodingTest.cs :
	  reverted part of the related patch, thus added NotWorking.


svn path=/trunk/mcs/; revision=72087
2007-02-01 12:43:52 +00:00
Gert Driesen 4f954982a9 * Encoding.cs: Also set ParamName of the ArgumentException.
* EncodingTest.cs: Improved test for not-supported encoding.

svn path=/trunk/mcs/; revision=72057
2007-01-31 22:22:48 +00:00
Gert Driesen 594236a635 Fixed typo.
svn path=/trunk/mcs/; revision=72056
2007-01-31 21:37:23 +00:00
Gert Driesen dc13e6c1f5 * EncodingTest.cs: Added tests for GetEncoding.
* Encoding.cs: In GetEncoding (int) do not allow codepage value below zero
and above 0xffff. Modified NotSupportedException to ArgumentException in
GetEncoding (string).
 * corlib_test.dll.sources: Added EncodingTest.cs.

svn path=/trunk/mcs/; revision=72052
2007-01-31 20:58:30 +00:00
Ben Maurer 6ed0bbc5c9 2006-10-25 Ben Maurer <[email protected]>
* Encoding.cs: Make the GetByteCcount method used fixed pointers
	removes quite a few allocations from Banshee.

svn path=/trunk/mcs/; revision=66970
2006-10-25 21:21:13 +00:00
Atsushi Eno dd908d994b 2006-08-24 Atsushi Enomoto <[email protected]>
* Encoding.cs :
	  Consider DecoderFallback and EncoderFallback in 2.0 Equals()
	  and GetHashCode().
	* UTF32Encoding.cs, UTF7Encoding.cs :
	  Fixed GetHashCode() and Equals() as well.
	  Added several missing overrides in 2.0.


svn path=/trunk/mcs/; revision=64299
2006-08-24 11:32:00 +00:00
Atsushi Eno d2a9a1a60e 2006-08-24 Atsushi Enomoto <[email protected]>
* Encoding.cs : implemented IsAlwaysNormalized().
	* Latin1Encoding.cs : IsAlwaysNormalized() does not return false
	  for FormC.


svn path=/trunk/mcs/; revision=64291
2006-08-24 07:50:23 +00:00
Kornél Pál b504254e01 Encoding.cs: Return big-endian UTF-32 in GetEncodings () and GetEncoding (int)
svn path=/trunk/mcs/; revision=61919
2006-06-21 21:47:43 +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 f943aba680 2006-05-25 Atsushi Enomoto <[email protected]>
* corlib_test.dll.sources : added EncodingInfoTest.cs.

	* EncodingInfo.cs, Encoding.cs :
	  Implemented Encoding.GetEncodings(). It's so hacky!

	* EncodingInfoTest.cs : new TestFixture.


svn path=/trunk/mcs/; revision=61128
2006-05-25 16:51:36 +00:00
Kornél Pál 8bc62b2049 * Encoding.cs: GetString (byte []): Wrap GetString (byte [], int, int) as MS.NET does. This is a more reasonable high level wrapper implementation.; * UnicodeEncoding.cs: GetBytes (string): Implement as a wrapper instead of using GetBytesInternal to be MS.NET compatible. Override GetString (byte [], int, int) to speed up string creation.
svn path=/trunk/mcs/; revision=59437
2006-04-13 11:08:04 +00:00
Zoltan Varga ad6cf59a62 2006-03-09 Zoltan Varga <[email protected]>
* Encoding.cs: Add stub for net 2.0 GetEncodings () method.

svn path=/trunk/mcs/; revision=57744
2006-03-09 19:23:21 +00:00
Atsushi Eno 3c311bcdc0 2006-01-20 Atsushi Enomoto <[email protected]>
* Encoding.cs : Cloned instances should not be read-only.

	* UTF8EncodingTest.cs : added CloneNotReadOnly().


svn path=/trunk/mcs/; revision=55823
2006-01-20 08:21:53 +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 c4c148abc8 2005-11-28 Atsushi Enomoto <[email protected]>
* Encoding.cs, ASCIIEncoding.cs, Latin1Encoding.cs :
	  Added IsSingleByte.

	* ByteEncoding.cs : added IsSingleByte.


svn path=/trunk/mcs/; revision=53551
2005-11-28 12:55:44 +00:00
Atsushi Eno 9c2d2b4bea 2005-11-28 Atsushi Enomoto <[email protected]>
* Encoding.cs : added UTF32.


svn path=/trunk/mcs/; revision=53539
2005-11-28 05:10:05 +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
Raja R Harinath ffa3d54b36 Make line-endings uniform
svn path=/trunk/mcs/; revision=53295
2005-11-21 06:05:42 +00:00