UTF-8 problem

Hi,

I’m developing a website locally using Radiant.

I’ve installed mysql using UTF-8 as the default charset.
If I run \s in the mysql command line it shows eveything is set to
UTF-8.
I’m using Navicat to manage Mysql, which also has UTF-8 as the default
charset.
I’ve also included between my Normal layout head tags.

And I’ve read the following related thread
http://lists.radiantcms.org/pipermail/radiant/2006-June/000442.html

The problem is, that when I write to the database using Radiant’s admin
back end, the accented characters (á,é,í,ó,ú) and the spanish letter ñ
appear scrambled in the mysql database. The chracters do render properly
in the browser via Radiant, although they don’t in the mysql database.
And
if I export my mysql database the characters appear scrambled.

: (

I appreciate any help.

Jose.

Does it make a difference if you set the content-type as part of the
page_headers hash?

On 10/16/06, [email protected] removed_emai[email protected] wrote:


Alexander H.
http://www2.truman.edu/~ah428

Hi,

Are you refering to the MORE link in the NORMAL Layout’s section? If so,
I’ve already set it to UTF-8 and it makes no difference.

My question would be.

Where do I specify what character encoding to use in the admin backend
when writing to the database? The NORMAL layout charset, I suppose,
refers
to the output rendered on the front end (website). What I want to know
is
if Radiant has a charset declared when writing to mysql?

Hope I’m making sense.
Thanks in advance.

Jose.

What I want to know is if Radiant has a charset declared when writing to mysql?

Radiant does not control the charset when writing to the database.
That’s a good question though. I haven’t ever seen a Rails app
actually doing that type of stuff.

On 10/16/06, [email protected] [email protected] wrote:

if Radiant has a charset declared when writing to mysql?

Hi,

Search: http://radiantcms.org/mailing-list/search/
Search: http://radiantcms.org/mailing-list/search/
Site: http://lists.radiantcms.org/mailman/listinfo/radiant


Radiant mailing list
Post: [email protected]
Search: http://radiantcms.org/mailing-list/search/
Site: http://lists.radiantcms.org/mailman/listinfo/radiant


Alexander H.
http://www2.truman.edu/~ah428

On 17/10/2006, at 8:42 AM, Chris Lloyd wrote:

I maybe totally wrong but I remember hearing somthing about full UTF-8
support coming into Rails 1.2.

Rails has kind-of supported utf-8 for a long time, there has just
been some traps which i think they are trying to get rid of, like
validations and other stuff (i think).

Jose, what version of mysql are you on? am I correct in thinking the
only problem is when you look at the data with the mysql command-line
client or export from mysqldump?

Bodhi

I maybe totally wrong but I remember hearing somthing about full UTF-8
support coming into Rails 1.2.

Chris

On 10/16/06, Alexander H. [email protected] wrote:

Radiant does not control the charset when writing to the database.
That’s a good question though. I haven’t ever seen a Rails app
actually doing that type of stuff.

That’s an issue I reported to John a few months ago. You can put the
“text/html; charset=utf-8” as content type for your own pages in the
layout pane so that is working.

The only place where pages are by default in iso8859-1 is the admin
interface. And there is no way
except by patching the views/code to change that.

Having an option for that would be nice.

Ollivier R. wrote:

That’s an issue I reported to John a few months ago. You can put the
“text/html; charset=utf-8” as content type for your own pages in the
layout pane so that is working.

I believe this was fixed a while back? This is in the application.rhtml
layout:

Does this not fix the problem?


John

Bodhi,

mysql> \s

mysql Ver 14.12 Distrib 5.0.22, for Win32 (ia32)

Connection id: 27
Current database: aflmm_dev
Current user: [email protected]
SSL: Not in use
Using delimiter: ;
Server version: 5.0.22-community-nt
Protocol version: 10
Connection: localhost via TCP/IP
Server characterset: utf8
Db characterset: utf8
Client characterset: utf8
Conn. characterset: utf8
TCP port: 3306
Uptime: 7 hours 48 min 16 sec

Your’e right. The characters render properly in the website and in the
Radiant admin backend. They only appear scrambled in the Mysql client
and
dump file.


[email protected] wrote:

The problem is, that when I write to the database using Radiant’s admin
back end, the accented characters (á,é,í,ó,ú) and the spanish letter ñ
appear scrambled in the mysql database. The chracters do render properly
in the browser via Radiant, although they don’t in the mysql database. And
if I export my mysql database the characters appear scrambled.

Just a wild guess: is the db connection in UTF8 mode? I.e. the first
statement executed by mysql needs to be:

SET NAMES ‘utf8’;

You can force this command by placing a “encoding: utf8” line into the
current environment’s section in database.yml.

Zsombor

Company - http://primalgrasp.com
Thoughts - http://deezsombor.blogspot.com

Hi Ollivier,

I’ve set “utf-8” in the content-type tab of the Layout’s pane. It makes
no
difference. I’ve also checked application.rhtml and it does contain

between the head.

My Mysql is set to utf-8 as the default charset. Accented characters
render properly in Radiant’s frontend (website) and backend (admin).
It’s
only when viewing the content directly from mysql or when dumping the
content in an .sql file that characters appear scrambled.

Jose.

Hi,

Thanks everyone who has kindly responded to my noobery. The problem was,
that I was managing the Mysql database using the Mysql Gui (provided in
the official Mysql page), and that program also has an option to set the
character encoding.

Now eveything is set to UTF8 and chracters render properly everywhere.

Bodhi, I’m using Windows locally to experiment with charset UTF-8,
because
I’m developing the website for the Archive of the Luis
Muñoz MarínFoundation in Puerto Rico, which inevitably needs support for spanish
characters. The new website will reside on a Linux hosting, I just
wanted
to make sure I could start working locally and then export everything to
a
remote machine.

By the way, please check out my first Radiant website, developed for the
Virtual Caribbean initiative of the University of Puerto Rico. It’s
still
running in development mode. But soon we’ll be finished and ready to
deploy in production.

http://cybrary.hpcf.upr.edu:3000

Nice mailing list people keep it up!

Jose.

On 18/10/2006, at 5:21 AM, [email protected] wrote:

My Mysql is set to utf-8 as the default charset. Accented characters
render properly in Radiant’s frontend (website) and backend
(admin). It’s
only when viewing the content directly from mysql or when dumping the
content in an .sql file that characters appear scrambled.

Does your terminal support utf-8? try hitting your website with curl
and see what your output looks like. Ah, I just read your other
email, seems like you are on windows? What programs are you using to
look at the sql dump?

Bodhi