Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Re: [eupos] Quotes and apostrophes do not display well

Quote Reply
Re: [eupos] Quotes and apostrophes do not display well In reply to
With glinks, in most cases, you can tell glinks to be in whatever character set and not touch the database. The only issue with this is that there's a small chance that you'll get incorrect search results and that will only happen if you have multi-byte characters and your search matches one byte of that multi-byte character. The other issue is when you do string operations that need to be mult-byte aware in MySQL and Perl (eg. string length). By default, glinks doesn't do any string operations like that in MySQL or in Perl.

What's important is that the connection character set (ie. how Perl connects to the MySQL) is the same as the database character set. This way no character set conversions happen when the data gets stored by MySQL. With glinks it communicates to MySQL by latin1 and MySQL by default is latin1 (though that might have changed with newer versions of MySQL). Even if we pass in utf8 data, no conversions happen and this is okay as long as when we display it, we tell the browser what character set it is.

One final advantage of doing things this way is that it's fast. We've found that with large sites, utf8 aware Perl and MySQL adds quite a bit of overhead.

Adrian
Subject Author Views Date
Thread Quotes and apostrophes do not display well banana123 8941 Oct 3, 2012, 12:21 PM
Post Re: [banana123] Quotes and apostrophes do not display well
eupos 8756 Oct 3, 2012, 12:25 PM
Thread Re: [banana123] Quotes and apostrophes do not display well
Andy 8777 Oct 3, 2012, 12:25 PM
Thread Re: [Andy] Quotes and apostrophes do not display well
banana123 8817 Oct 3, 2012, 1:36 PM
Thread Re: [banana123] Quotes and apostrophes do not display well
eupos 8767 Oct 3, 2012, 1:39 PM
Thread Re: [eupos] Quotes and apostrophes do not display well
banana123 8773 Oct 3, 2012, 1:44 PM
Thread Re: [banana123] Quotes and apostrophes do not display well
eupos 8753 Oct 3, 2012, 1:52 PM
Thread Re: [eupos] Quotes and apostrophes do not display well
banana123 8752 Oct 3, 2012, 2:06 PM
Thread Re: [banana123] Quotes and apostrophes do not display well
banana123 8697 Oct 4, 2012, 7:00 AM
Post Re: [banana123] Quotes and apostrophes do not display well
Andy 8688 Oct 4, 2012, 7:23 AM
Post Re: [eupos] Quotes and apostrophes do not display well
brewt 8686 Oct 4, 2012, 6:48 PM