0

Hi all,

I have a text file saved as utf8 without BOM. I loaded it into MysQL database.
An iframe is loaded with this data from MySQL. I need the caret position in the iframe in order to perform operations in the database. Everytime there's a new line the positions don't match.

For example: caret position 52 in iframe is the first character in a newline, and this letter in MySQL text column corresponds to substr(text,55,1), and the text is exactly the same..

2
Contributors
1
Reply
2
Views
5 Years
Discussion Span
Last Post by smantscheff
0

Make sure that all parts work in the same character set - database, tables, fields, connection, html encoding, javascript encoding. The position differences most likely are due to one side counting the utf8 2-byte codes as one character, while the other side counts them as two characters.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.