translation tool

A place for users and developers of the Xataface to discuss and receive support.

translation tool

Postby Martin Pruss » Tue Jul 21, 2009 1:07 am

Hi Steve hi XF users...

Currently I am trying to translate my DB entries. This works fine with the translation Tool.
But when I add the folowing:
[languages]
de=de
en=en
fr=fr

to my conf ini , all the special characters in the DB like: üäöß
don't show up correctly.
I already tried to add:
oe = UTF-8
ie = UTF-8
at the beginning of my conf ini with no luck

Do you have any ideas?
Cheers
Martin
Martin Pruss
 
Posts: 61
Joined: Tue Oct 23, 2007 2:22 pm
Location: Berlin

Postby Byte » Tue Jul 21, 2009 1:14 am

The information with oe and ie is wrong/depreciated.
Use this (works fro me):

default_oe="UTF-8"
default_ie="UTF-8"
Byte
 
Posts: 13
Joined: Thu Jul 16, 2009 3:48 am

Postby Martin Pruss » Tue Jul 21, 2009 2:37 am

Hi Byte...
I tried this as well ..but still no luck...
but thanks for the reply

Martin
Martin Pruss
 
Posts: 61
Joined: Tue Oct 23, 2007 2:22 pm
Location: Berlin

Postby Byte » Tue Jul 21, 2009 2:53 am

Since it is working for me:
Do you have all your table fields configured to be UTF-8? This is something that I keep forgetting all the time...
Byte
 
Posts: 13
Joined: Thu Jul 16, 2009 3:48 am

Postby Martin Pruss » Tue Jul 21, 2009 5:24 am

mhh..
I am not sure what consequeces this will have to my data...
will it actually change the data (irreversible)? or does it just change the way the data is rendered? does it change the way data is stored from now on or also the old data?
Currently this data is mostly used in some flash applications on the front end with Xataface as backend.
Only the backend, which is maintained mostly by me and some collegues, shows the wrong characters. So before I mess up the characters on the flash frontend, I better live with the cryptic special characters in the non public backend.
Thanks for your help...
Cheers
Martin
Martin Pruss
 
Posts: 61
Joined: Tue Oct 23, 2007 2:22 pm
Location: Berlin

Postby shannah » Tue Jul 21, 2009 11:56 am

It shouldn't be necessary to change your tables to utf8. That is only necessary if you are using a language like chinese that won't map nicely from utf8 to latin-1. Mysql makes the conversion for you at runtime.

As you suspect, changing the data format can have repercussions - especially if you have other systems interfacing with the data.

In the resulting HTML page, what does your http-equiv tag say?
e.g.
Code: Select all
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>


-Steve
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Postby Martin Pruss » Tue Jul 21, 2009 2:21 pm

Hi Steve
It looks like:
Code: Select all
<meta>
Martin Pruss
 
Posts: 61
Joined: Tue Oct 23, 2007 2:22 pm
Location: Berlin

Postby Martin Pruss » Tue Jul 21, 2009 2:23 pm

hey ... post has been eaten by phpbb

Code: Select all
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
Martin Pruss
 
Posts: 61
Joined: Tue Oct 23, 2007 2:22 pm
Location: Berlin

Postby shannah » Tue Jul 21, 2009 2:29 pm

Were these special characters entered using Xataface or using another mechanism?
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Postby Martin Pruss » Tue Jul 21, 2009 2:32 pm

post variables from Flash via (external) PHP script
..I forgot to mention that this is still dataface-0.7.1
Martin Pruss
 
Posts: 61
Joined: Tue Oct 23, 2007 2:22 pm
Location: Berlin

Postby shannah » Tue Jul 21, 2009 2:46 pm

It could be an encoding issue on that end. If flash/php is (for example) encoding these characters as UTF-8 when they are inserted into the database, but the database is expecting Latin-1, it will still work. And if the application retrieves the text later and displays it - that will work also. However if a different app that is working correctly with the encoding tries to interact with the data, you'll see that some of these characters look like gibberish.


The key is that the HTML form, the PHP script, and the MySQL database have to be aligned on the type of encoding to use in a given request. The database need not be encoded as UTF-8. MySQL can set the input/output encoding at runtime via the
character_set_client
character_set_results
and names
variables. Here is a snippet from Dataface_Application where Xataface sets this:

Code: Select all
if ( $this->_conf['oe'] == 'UTF-8' ){
   $res = mysql_query('set character_set_results = \'utf8\'', $this->_db);
   mysql_query("SET NAMES utf8", $this->_db);
}
if ( $this->_conf['ie'] == 'UTF-8' ){
   $res = mysql_query('set character_set_client = \'utf8\'', $this->_db);
         
}


This must be done to tell mysql that it is working in UTF-8 for this request.

Do you know whether your flash script and PHP script are working with the data as utf-8 or latin-1?

My prediction to support this hypothesis is: If you try to enter a record via Xataface using special characters, they will come out looking right in Xataface. But in your Flash app they will probably look gibbled.

-Steve
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Postby Martin Pruss » Wed Jul 22, 2009 1:01 am

Hi Steve..
My prediction to support this hypothesis is: If you try to enter a record via Xataface using special characters, they will come out looking right in Xataface


Not quite... öäüß becomes öüäß after saving in xataface (0.7.1).
When i remove:

Code: Select all
[languages]
de=de
en=en
fr=fr


from conf ini the special characters are displayed properly.

How do I find out wether php is working with the data as utf8 or latin-1?
In the script there is no definition about this..
it is just receiving POST variables and inserts them in my DB like this:
Code: Select all
'" . mysql_real_escape_string($_POST[id]) . "',


Thanks for continuously taking care of my coding problems
Martin
Martin Pruss
 
Posts: 61
Joined: Tue Oct 23, 2007 2:22 pm
Location: Berlin

Postby Jean » Wed Jul 22, 2009 6:57 am

Hi Martin,
Some questions :
    Are your files saved in UTF-8 without BOM ? It is possible with free editors like PSPad...
    Is your Apache server (httpd.conf) or a .htaccess configured with
    Code: Select all
    AddDefaultCharset UTF-8

Cheers
Jean
Jean
 
Posts: 259
Joined: Wed Nov 07, 2007 1:30 am
Location: Pau, France

Postby Martin Pruss » Wed Jul 22, 2009 7:55 am

Hi Jean...
When i do this:
Code: Select all
AddDefaultCharset UTF-8

All special characters are wrong
after i removed:
Code: Select all
[languages]
de=de
en=en
fr=fr


When i insert it again and define a htaccess with "AddDefaultCharset UTF-8" only for the backend
everything works....yippee

but only for the database entries..
i probably have to save all field ini files without "bom" because they now show a ? instead of special characters

Thanks for your help
Martin
Martin Pruss
 
Posts: 61
Joined: Tue Oct 23, 2007 2:22 pm
Location: Berlin

Postby Jean » Wed Jul 22, 2009 8:22 am

Don't forget to save your language files in UTF-8 without BOM too...

I noticed something:
sometime you have to save in ANSI then in UTF-8 to have them correct.
Jean
 
Posts: 259
Joined: Wed Nov 07, 2007 1:30 am
Location: Pau, France

Next

Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 22 guests

cron
Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved