Note that there are some explanatory texts on larger screens.

plurals
  1. POQuercus PHP Grails Character Encoding Issue
    primarykey
    data
    text
    <p>I am successfully using the latest resin jar (from <a href="http://www.caucho.com/download/" rel="nofollow">http://www.caucho.com/download/</a>) to allow me to utilize legacy PHP code within my Grails web application. Everything renders great, EXCEPT non-ASCII character sets. </p> <blockquote> <p>These characters show up as question marks, and looks like this: <strong>???? ?? ???</strong>.</p> </blockquote> <p>I've tried numerous solutions:</p> <p>From setting php.ini to be <strong>utf8</strong>, to making sure <code>extension=php_mbstring.dll</code> is included in php.ini. I have also ensured that the MySQL database is configured to do utf-8. The characters stored in the database show up correctly in phpMyAdmin.<br> Also, I am able to do a <code>die("BLAH")</code>, where <em>BLAH</em> is non-ASCII text, and it will output correctly to the browser. My browser shows content header utf-8 on all the pages.</p> <p>Another kicker is that I am able to take the PHP codebase running within Grails, and run it inside a <em>WAMP</em> server on the <strong>SAME</strong> machine, connecting to the <strong>SAME MySQL</strong> database, and it outputs the non-ASCII characters just fine. </p> <p>My feeling is that it is a data transfer issue from MySQL to the PHP running in Grails (remember, it works from MySQL to the same PHP running in WAMP). In both cases, I am even performing <code>mysql_query("SET NAMES 'utf8'")</code> before running my query.</p> <p>I have also tried taking the WAMP php.ini file and using it in Grails, and Grails PHP still won't play nice...Part of me thinks that somehow the PHP in Grails isn't reading the php.ini file, and is falling back on some default php.ini (which I don't know about).<br> For example, if I make the Grails php.ini file an empty file, Grails still starts fine, and I can render php pages. BUT if I set php.ini to garbage text like "asdfasdf", Grails will not start...so that leads me to believe it is seeing the php.ini...</p> <p><em>Additional info:</em></p> <ul> <li>MySQL version: <strong>5.0.22</strong></li> <li>PHP version in Grails (resin/Quercus): <strong>5.3.2</strong></li> <li>PHP version in WAMP: <strong>5.1.4</strong></li> <li>Grails version <strong>2.2</strong></li> </ul> <p>I have tried everything I've found online, but no luck... Thanks for your help!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload