Closed Simplxss closed 1 year ago
In general, you shouldn't use fixed length string. MDF file format and strings, doesn't go well together.
If you change the string channels data type to a variable length type and set data size to 4 or 8 bytes (this is the index size). See also unit test TestWrite::StringData.
However fixed length strings should work. I do a unit test for this and check what's the problem is.
I think the problem is solved. It was working for the first channel but not for the next channels. You can verify in .NET world.
It works well now, but I'm confused that why it needs to convent ASCII to UTF-8 encoding. In my view that UTF-8 contains ASCII tables.
From: Ingemar Hedvall @.> Sent: Wednesday, July 26, 2023 3:46 PM To: ihedvall/mdflib @.> Cc: Simplxs @.>; Author @.> Subject: Re: [ihedvall/mdflib] Cannot read string value written by MDFWriter (Issue #26)
I think the problem is solved. It was working for the first channel but not for the next channels. You can verify in .NET world.
— Reply to this email directly, view it on GitHubhttps://github.com/ihedvall/mdflib/issues/26#issuecomment-1651159022, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AKUBLRDRSHUYJ44IXAAUHF3XSDDNLANCNFSM6AAAAAA2X3WJZU. You are receiving this because you authored the thread.Message ID: @.***>
I think ASCII also include the 0x10-0xFF characters. I'm using UTF8 if possible.
I have a question regarding timestamp value. C++ is still missing a timestamp value but when using Protobuf/gRPC. I'm using a protobuf version. Do C#/.NET have a standard way of expressing an absolute time which is better than using the nano-second definition from C++?
Sorry, in fact I'm not familiar with C#/.NET. But I don't think there is an appropriate way to process time better than timestamp. DateTime in C# could only handle 1/10 000 ms at most.
It is coming in .NET 7(+?)
Yes, DateTime will be impoved in .NET 7, but we can't trial it before .NET 8 releasing...
Detail code see
TestWriter
&TestReader2
functions in google test.I viewed the output file and found the string seems writting correctly(?).
But all values in
value_list_
of ChannelObserver are "" when reading. It seems that there are some problems inReader.ReadData()
. I have tried to solve it, but It's a little diffcult for me to fully understand how it works...