Comments (5)
Hi,
for the mappings I never managed to rebuild them till version 96B.
You could try with 94B and see what kind of result you get...
But firstly, does the Parser create the array correctly or the character problem occurs there?
from edifact.
Hi Sabas, thanks for your quick response.
It seems the parser can read the file content after decoding, even the file have syntax error (my opinion).
The error count is >0, but there is no error message, so I had to comment out the return to see something.
<?php
require_once '../vendor/autoload.php';
use EDI\Parser;
$edifile = utf8_decode(file_get_contents("example.edi")); //it's a path!
$p = new EDI\Parser($edifile);
if (count($p->errors()) > 0) {
echo "Error: ";
echo json_encode($p->errors());
// return;
}
echo "JSON:";
echo json_encode($p->get());
// echo "Var dump";
// var_dump($p->get());
The EDI file syntax errors in my opinion:
- there are two extra characters before a CNT tag, like this: -FCNT -> I guess, the -F is an error
- there are two completely missing messages - UNH....UNT
- there is one missing UNT after an UNH.... and its content, in other words, next UNH started without a closing UNT
- due to the missing UNT and messages, the file closing UNZ contains 11, but real messages (counting UNH) was only 9
Do you think, these syntax errors could cause issues?
from edifact.
Anyway, I just realized even I got error messages if I do not use the utf8_decode, the array filled up with data.
Printing it as json or var_dumo, I do not see any utf8 characers, they are removed from the strings. Di I miss something?
from edifact.
I think at this moment I would be happy with only the parser working with original UTF8 strings....
I could manage the array and get out what I want (mapping some data), so, I play with the stripchars to not detect and remove above x80.
from edifact.
At this moment I suspend this original question.
from edifact.
Related Issues (20)
- Release 0.5.0 not available via Composer HOT 2
- Possibility to have IDs instead of name as output from Interpreter::prepare HOT 5
- CDR read HOT 4
- Problems reading RFF segment from EDI-File HOT 1
- Array to string conversion, if an epty array met. HOT 1
- X12 HOT 6
- Package ramsey/array_column is abandoned HOT 2
- Trouble understanding how to get the data we need HOT 5
- Segment is ambiguous HOT 1
- Elements with maxrepeat > 1 should be considered arrays when parsed as json HOT 6
- Reader doesn't return full multi-line texts HOT 4
- UNA does not container new line character HOT 5
- UTF8 characters handling in input edi file HOT 15
- How to create edi document with .edi extension for healthcare HOT 4
- readEdiSegmentDTM for SG12 HOT 5
- File has multiple messages HOT 6
- question marks are not parsed correctly HOT 5
- Fatal error on integer-value segments for Encoder HOT 2
- Reader cannot be init with a null param HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from edifact.