[Mono-list] Problem with Encoding.Default

Carlos Guzmán Álvarez carlosga@telefonica.net
Sat, 16 Nov 2002 22:49:23 +0100


Hello:


I´m reviewing the source of the default encoding, 
UTF8Encoding.GetByteCount(string s) calculates the length on bytes but 
at the end it adds 3 bytes more if the encoding is created with 
encoderShouldEmitUTF8Identifier :

	return length + (emitIdentifier ? 3 : 0);

I´m making test with csc and this seems to be incorrect
on ms .net the 3 bytes of the preamble are not added to the byte count ( 
  at least on my tests).

Can be this the problem exposed in my first post??? ( I think that it´s )



Best Regards
Carlos Guzmán álvarez
Vigo-Spain