Re: serializing an object to a string

From: Marco Herrn (nospam_marco.herrn_at_sourcepark.org)
Date: 03/15/05


Date: Tue, 15 Mar 2005 12:26:06 +0100

Hi Helge,

Helge Jensen wrote:
> Marco Herrn wrote:
>> Another problem is: Is UTF8 Encoding the correct one? Would be another
>> encoding more appropriate?
>
> There is probably no reason to even set the encoding.

But when converting the byte Array to a string I need to use a Encoding.
Or is there a different way of this conversion?

Thanks for your code example. It works. But still lacks the conversion
to a string. How can I convert the buffer _without_ converting the extra
bytes at the end?

Regards
Marco



Relevant Pages

  • Re: Changing garbled text ("???? ??????") to readable text ("?? ???")
    ... should be converting from your original file's *binary* data into a ... string using an encoding. ... I'll be dealing with ID3 tags and the data returned from the ID3 tag ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Convert Encoding from Shift-JIS to UTF-8
    ... No. You're converting the string into UTF-8, ... > converting one encoding to another using .Net. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Pre-information on Unicode in Delphi 2008
    ... Well IMO this is one case where Delphi isn't doing strong typing, there should be a warning there and a requirement for an explicit cast. ... Converting from Ansi to Wide while assuming the Ansi is using the system_locale is just an assumption, and in the Delphi IDE itself, that can results in string corruption when editing DFMs, and before you ask, yes there are QCs on the subject:) ... AnsiString have no particular encoding at all, assuming *any* encoding for automagic conversion is going to result in hard-to-track cases of data ...
    (borland.public.delphi.non-technical)
  • Re: [FC2] Character set problem, still there :(
    ... > different encoding and may or may not contain encoding information that ... like for converting all my old file as UTF-8 ... how are displayed UTF-8 under windows? ... I just mount my iRiver as a normal 20Go HDD thourh my USB post ...
    (Fedora)
  • Re: TripleDES encryption problem
    ... ASCII is only a 7-bit encoding, and your key uses the full 8-bit space ... >> Somehow converting the output of DesEncrypt to a string and then ...
    (microsoft.public.dotnet.security)