Kevin
Tue Nov 29 08:29:43 CST 2005
I don't believe there's any built-in mechanism for this. The
StreamReader.ReadLine method will read up to a CR or CR/LF combination, and
not read the line terminator sequence. So you could use this method, and
append the appropriate line terminator, or you could simply replace for the
whole string (which is what I think I would do).
--
HTH,
Kevin Spencer
Microsoft MVP
.Net Developer
If you push something hard enough,
it will fall over.
- Fudd's First Law of Opposition
"??" <@discussions.microsoft.com> wrote in message
news:A175FD60-D027-48AA-8662-37983879D66A@microsoft.com...
> First thank you,
>
> Then,
>
> I use the following code to try
>
> [
> //FileStream * theFile
>
> StreamReader * FileReader = new StreamReader(theFile,Encoding::Unicode);
> String * sTemp = FileReader->ReadToEnd();
>
> Encoding * unicode = Encoding::Unicode;
>
> FileReader->Close();
>
> FileBuffer = new unsigned char __gc[sTemp->Length +1];
> FileBuffer = unicode->GetBytes(sTemp);
> FileBuffer[sTemp->Length] = '\0';
> ]
>
> I notice that the double-byte Charactor is converted to two single-byte
> Charactors as 8-bit usigned char . East Asia Language is converted to
> 0x7F+
> Charactors. It works perfectly.
>
> But the converting of "\13\10" to "\10" does not happen....
>
>
> What's the correct solution of this?
> Will you please give out some code?
> =========================================================================
>
> "Kevin Spencer"??:
>
>> See the System.Encoding class:
>>
>>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemtextencodingclasstopic.asp
>>
>> --
>> HTH,
>>
>> Kevin Spencer
>> Microsoft MVP
>> ..Net Developer
>> If you push something hard enough,
>> it will fall over.
>> - Fudd's First Law of Opposition
>>
>