Have you checked the hexdump? There is a reason why I am pointing you so hard towards the hexdump. You need to eliminate your ssh session, your terminal program and your terminal settings from the equation. It might be that your terminal displays question marks for one machine because the connection or the environment is set up differently. So, please, do not look at "the question marks" but do look at the output bytes you get.
If the output bytes are different, then the difference lies earlier on the way the data takes through your systems. Start working your way towards the input further:
Check locales and terminal encoding setup. Do they match between machines? Are they properly set up to be UTF-8? You've done that.
- Check the data format in your script as it writes to its output. Is it properly encoded from Unicode to the target encoding? Compare the hexdumps.
- Check the data format in your script as it reads the data from the database. Is it utf8 everywhere? Compare the hexdumps.
- Check the data format in your database in all tables. Are the tables/columns declared to be utf8/Unicode everywhere? Compare the hexdumps.
- Check the data format when it is written from your script to the database. Do they write utf8/Unicode everywhere? Compare the hexdumps.
- Check the data format from where your script gets its data. Is it properly decoded from the source to utf8 everywhere? Compare the hexdumps.
You have to work your way through this list in either direction, but you have to inspect all data transitions where one system hands off data to the next. Displaying raw bytes to the console is such a transition, so always inspect hexdumps instead of raw bytes.
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.