Mmmmm, I should have mentioned that my 1st attempt at problem solving was to create a string using the chr function and printing the result to the console. This worked ok.

However, I will include another code test snippet here for clarification.

use DBI; use DBD::ODBC; my $username = shift; my $password = shift; my $oracle_db = shift; # --- Get data from DB $dbh = DBI->connect("DBI:ODBC:$oracle_db","$username","$password") or die ("Could not make connection to database:\n". "$DBI::errstr\n"); $dbh->{RaiseError} = 1; my $sql_statement = 'SELECT A.LABEL, A.COMMENTS FROM mydb.table WHERE A.LABEL = ?'; $parm_cursor = $dbh->prepare ( $sql_statement ); $parm_cursor->execute('MYLABEL'); (my $label, my $comment) = $parm_cursor->fetchrow_array(); # --- Verify output from DB print "$comment\n"; my @nums = map ord, split //, $comment; print join ' ', @nums,"\n"; # --- Verify that console can print a degree sign my $str = "30 degrees = 30".chr(186); @nums = map ord, split //, $str; print "$str\n"; print join ' ', @nums,"\n";
And the output is: (Solaris. Perl 5.8.2)
INITIAL VALUE IS 0.0? 73 78 73 84 73 65 76 32 86 65 76 85 69 32 73 83 32 48 46 48 63 30 degrees = 30º 51 48 32 100 101 103 114 101 101 115 32 61 32 51 48 186
And the output is: (Windows. Perl 5.6.1)
(The degree sign actually doesn't look like a degree symbol, it looks like a double-vertical-line, but I really don't care.)
INITIAL VALUE IS 0.0º; 73 78 73 84 73 65 76 32 86 65 76 85 69 32 73 83 32 48 46 48 186 30 degrees = 30º; 51 48 32 100 101 103 114 101 101 115 32 61 32 51 48 186
Is this a bug or a feature??

I can't reinstall perl 5.6.1 on Solaris to check it (the CM and QA people would shoot me!), but I am beginning to think that this is not a Windows/Solaris difference, but a difference between perl 5.6.1 and 5.8.2.


In reply to Re: Re: Re: Re: DBD:ODBC does not return characters with ascii value > 128 correctly (5.8.2 on Solaris -> 5.6.1 on Windows works) by Sandy
in thread DBD:ODBC does not return characters with ascii value > 128 correctly (5.8.2 on Solaris -> 5.6.1 on Windows works) by Sandy

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.