On 3 July 2013 11:18, Craig Chant <[email protected]> wrote:
> >> Maybe write a standalone test and take Catalyst and browser quirks > out of the picture. > > I have already done this, I have two SQL wrapper modules one that uses > DBI::DBD::ODBC and one that uses Win32::ODBC, I applied it to the same > standalone script that produces CSV output, the only difference between the > test was one test accessed SQL with the DBI SQL wrapper and one test > accessed SQL with the Win32::ODBC SQL wrapper, DBI outputted junk chars, > Win32::ODBC didn't. What else should I be doing to test for the culprit of > the corruption? > You need to see how they are using the ODBC API underneath for handling the data and encoding. Setting the trace flag on DBI (i.e. DBI->trace(n)) will expose the DBD::ODBC activity. I'm not sure of the debugging available for Win32::ODBC. One thing I would check first is what they are treating the column data as. If DBD::ODBC is treating the columns as WCHAR but Win32::ODBC is treating them as CHAR and then doing extra "magic" decoding (or not), well then you've found a big clue. There has to be different handling or differing levels of ODBC support somewhere. I would assume that DBD::ODBC is doing "the right thing", and something else is amiss upstream (but well, never assume with Unicode handling, so make sure with the trace). > >> Also, you are aware that your data will probably be coming back as UCS2 > if you're using SQL Server right? > > > No, what is UCS2 and is this handled differently in DBI::DBD::ODBC vs > Win32::ODBC ? > > > >From what I understand, is ultimately what you've got happening?: Original Input Data -> SQL Client -> Database Driver -> Database (UCS2) -> Windows ODBC Driver -> DBD::ODBC -> Catalyst(?) If so, since you're storing the data as Unicode and the database driver knows this (because your column type is NVARCHAR etc.), conversion to UCS2 happens at the driver stage on Windows. This is lossless between the different Unicodes, so just make sure your input is actual good Unicode up to that point and your data is being stored correctly. Your data is being stored in Unicode data typed columns right?
_______________________________________________ List: [email protected] Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/[email protected]/ Dev site: http://dev.catalyst.perl.org/
