This ones pretty simple, i'm not very familiar with mysql, but I have a c# app inserting found data. That data contains \n, but as I said it turns into the funny square
When you're looking at a text column it'll probably get converted to ascii. Since the newline character isnt ascii but Unicode it'll show up as the 'unknown' character aka the little square.
The conversion can occur when inserting the data in code, conversion in the database in the insert query, when showing the data or reading the data in code. So there are a lot of places this can go wrong.
Read up about text encoding and see the link pRimE posted.
like Bala R wrote in the comment, it depend's where you display your text.
a non multiline textbox control might screw up if it encounters a newline char.
additionally, begining a new line is a platform dependant thing ... on *NIX like platforms you usually have \n and that's it. windows usually uses \r\n as sequence for a linebreak
精彩评论