View Full Version : How do I stop character encoding...
speedway
03-01-2006, 08:02 AM
I am having an issue with the threads generated by VbDrupal. Any apostrophes etc are bing converted to some weird characters. See this thread on my test site:
http://ascnew-2.ksl.com.au/forum/showthread.php?t=9119
However, the same text in Drupal looks fine:
http://ascnew-2.ksl.com.au/node/8
Can someone tell me how to stop the conversion to these weird characters as this is a show stopper for me....
Thanks
Bruce
I tried this on my install and could not replicate your issue.
1 thing you might want to try is your forum uses
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
while Drupal theme uses
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
try changing your forum content-type in the head_include template to the same as your drupal theme
not sure if it will help, but its all I can think of.
tamarian
03-02-2006, 08:00 AM
You can try turning it off from sites/default/config.php, there's a setting for it.
speedway
03-02-2006, 04:36 PM
Thanks Guys
It is not actually anything to do with vBDrupal, but Drupal itself. Drupal seems to be putting these chars into the DB during the save process. I tried an install of standard Drupal 4.6.5 and 4.7b4 and they both do the same, on 2 different machines, a local next to my desk and my host. I asked the question of where could these be coming from over at drupal.org but I won't hold my breath waiting for an answer. If I can't sort this out, I'll have to drop Drupal as my front end platform and look into ezPublish....
Cheers
Bruce
speedway
03-02-2006, 04:39 PM
This is what was entered in the front end:
ferocious furor of the 410’s fire-up this Saturday night – this week in anger – as the five week absence of Sprintcars at Tyrepower PCR is torn apart as the Sprintcar’s topflight tussle for the top-ranked honours in the Tyrepower PCR Sprintcar Championship
and this is straight from my DB, as saved by Drupal:
ferocious furor of the 410’s fire-up this Saturday
night – this week in anger – as the five week absence of Sprintcars
at Tyrepower PCR is torn apart as the Sprintcar’s topflight tussle
for the top-ranked honours in the Tyrepower PCR Sprintcar
Championship
It doesn't matter what I use to post the info, beit Firefox on Suse 9.3 or IE on XP, it all goes in the same.
but I cannot replicate your problem on my Drupal installation, meaning the problem is not Drupal specific. Have you tried changing your charset in VB as I suggested?
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
speedway
03-02-2006, 06:21 PM
but I cannot replicate your problem on my Drupal installation, meaning the problem is not Drupal specific. Have you tried changing your charset in VB as I suggested?
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
Yup, changed the charset of VB and it didn't make a scrap of difference. That's why I tried plain vanilla Drupal with no VB interaction - same thing. Then I took the text and posted it directly into the DB field via phpmyadmin. The DB did not do anything with the chars and accepted the input as is. However, when I open the record in Drupal, it displays with some other chars in place of the apostrophes etc.
I enabled the devel module to try and see what is going on. Unfortunately, the queries shown do not include the insert query from a node save. The only query I am seeing is a REPLACE INTO on the cache table and that text looks like it should.
This is really strange I can tell you!
tamarian
03-02-2006, 07:46 PM
Does your PHP installation have the iconv library?
speedway
03-02-2006, 11:27 PM
Not sure Tamarian, would it be linked in during a php complie? Here's my list from the local test box:
'./configure' '--prefix=/usr' '--datadir=/usr/share/php' '--mandir=/usr/share/man' '--bindir=/usr/bin' '--libdir=/usr/share' '--includedir=/usr/include' '--sysconfdir=/etc' '--with-_lib=lib' '--with-config-file-path=/etc' '--with-exec-dir=/usr/lib/php/bin' '--disable-debug' '--enable-inline-optimization' '--enable-memory-limit' '--enable-magic-quotes' '--enable-safe-mode' '--enable-sigchild' '--disable-ctype' '--disable-session' '--without-mysql' '--disable-cli' '--without-pear' '--with-openssl' '--with-apxs2=/usr/sbin/apxs2-prefork' 'i586-suse-linux'
and the one from my live site:
'./configure' '--enable-pic' '--with-apxs=/usr/local/apache/bin/apxs' '--prefix=/usr/local' '--with-xml' '--enable-bcmath' '--enable-calendar' '--with-curl' '--enable-ftp' '--with-gd' '--with-jpeg-dir=/usr/local' '--with-png-dir=/usr' '--with-xpm-dir=/usr/X11R6' '--with-gettext' '--enable-mbstring' '--enable-mbstr-enc-trans' '--enable-mbregex' '--with-mcrypt' '--with-mhash' '--enable-magic-quotes' '--with-mysql=/usr' '--enable-discard-path' '--with-pear' '--enable-sockets' '--enable-track-vars' '--with-ttf' '--with-freetype-dir=/usr' '--enable-gd-native-ttf' '--with-zip' '--with-zlib'
tamarian
03-04-2006, 04:09 PM
Yes, --with-iconv
speedway
03-07-2006, 04:33 AM
Thanks Tamarian
I now have all the require bits linked in to PHP (mbstring & iconv) and still no difference. Would someone be good enough to tell me what the collation is on their VB database & tables? There has to be something that I can do before I give up altogether...
Cheers
Bruce
speedway
03-07-2006, 04:21 PM
Hmmm...
I have no idea what I did but it all seems to have stopped and come back to "normal" now...just have to figure out what i did!
Cheers
Bruce
tamarian
03-07-2006, 07:51 PM
Hmmm...
I have no idea what I did but it all seems to have stopped and come back to "normal" now...just have to figure out what i did!
Cheers
Bruce
It may have been delayed by the cache :)