jugglingcats / tachograph-reader

Read driver and vehicle card data and convert to a more usable XML format
80 stars 61 forks source link

Can't process files. 'ISO-8859-16' is not a supported encoding name #56

Closed luisaintonio closed 4 years ago

luisaintonio commented 4 years ago

When I try to run the script, for both driver and vehicle .ddd files, this is the output i get:

Warning! Current platform doesn't support encoding with name ISO-8859-16 'ISO-8859-16' is not a supported encoding name. For information on defining a custom encoding, see the documentation for the Encoding.RegisterProvider method.

It runs the driver file, but the vehicle gives me "Unknown codepage 255".

Where is the output supposed to go? Because the driver file, appears to have been processed.

@diogocp conseguiste correr este script? reparei que tinhas contribuído, precisava mesmo disto a correr. se me pudesses dar uma ajuda, ia agradecer muito.

jugglingcats commented 4 years ago

Are you running the included app/script? If so you should be able to specify the output file name, like:

the_app.exe --vehicle <ddd_file> <output_file>

I would not worry too much about the warnings if the output is usable for you. Pretty sure it will default to iso-latin-1 and ASCII.

luisaintonio commented 4 years ago

where is this app/script? do i need to compile the program first? @jugglingcats

davispuh commented 4 years ago
Warning! Current platform doesn't support encoding with name ISO-8859-16
'ISO-8859-16' is not a supported encoding name. For information on defining a custom encoding, see the documentation for the Encoding.RegisterProvider method.

That comes from https://github.com/jugglingcats/tachograph-reader/blob/master/src/regions/CodePageStringRegion.cs#L32 It seems that might need to use different code page for it based on wiki https://en.wikipedia.org/wiki/ISO/IEC_8859-16

ISO-8859-16 is the IANA preferred charset name for this standard when supplemented with the C0 and C1 control codes from ISO/IEC 6429. Microsoft has assigned code page 28606 a.k.a. Windows-28606 to ISO-8859-16.

As for

It runs the driver file, but the vehicle gives me "Unknown codepage 255".

That's normal/expected behavior. I have noticed that some DDD files contain 255 as codepage, most likely it means that string is empty/haven't been assigned. So most likely there could be added a case for this to not output it but I would suggest looking more into it.

luisaintonio commented 4 years ago

Do you have any documentation you used to develop this script? I'm working for a company and need to parse the .ddd files into a readable format. So understanding the code would be a great head start. Could you also help me with how to properly run the script? There is no provided executable, and on Visual Studio, i can only run the framework OR the core, separately. This would be of tremendous help. @jugglingcats @davispuh @diogocp

jugglingcats commented 4 years ago

@luisaintonio, you should be able to include all the files from src in a new project and write your own main using the basic instructions in the project readme - the script is just an example.

@davispuh, I just tried to checkout master and debug using vscode and I got errors - would not execute. It's been a while since I've worked on this project - do we need some basic instructions for people getting up and running in vscode / visual studio? I'm not really working with C# any more and never did anything with dotnet core...

luisaintonio commented 4 years ago

by doing that, i came across one of the errors I had before. Basically this:

Stream stm = a.GetManifestResourceStream(name);

is setting stm to null. which gives a System.ArgumentNullException. i cannot get over this.

@jugglingcats

luisaintonio commented 4 years ago

does the fact that you used the 2002 documentation, can have anything to do with the problems that I am having. Obviously i'm using .ddd files retrieved from digital tacographs, but this is not working

jugglingcats commented 4 years ago

The 2002 spec is for the gen 1 cards. There is an open issue for the gen 2 cards... see #42. So unless you are using gen 2 cards this is not your issue.

The ArgumentNullException is most likely happening if you did not change the two .config source files to have Build Action Embedded Resource. Hopefully that will get you further along.

davispuh commented 4 years ago

I just tried to checkout master and debug using vscode and I got errors - would not execute. It's been a while since I've worked on this project - do we need some basic instructions for people getting up and running in vscode / visual studio? I'm not really working with C# any more and never did anything with dotnet core...

I actually never used it on Windows or with Visual Studio so no idea. I was building it for .NET Core and Mono on Linux and last time everything was working fine. For .NET Core it's just simple dotnet build and with Mono it's msbuild but you must have all the dependencies installed first and it varies based on distribution. Also need this https://dotnet.myget.org/feed/dotnet-corefxlab/package/nuget/System.Security.Cryptography.Asn1.Experimental

luisaintonio commented 4 years ago

thanks a lot for the help guys. i finally got it to work. thank you again