Page 1 of 1

Internationalization UTF-8

PostPosted: Wed Nov 07, 2007 2:18 pm
by Anthony Barber
Hi Steve,
Many thanks again for your last help.

Dataface has a lang directory with a German ini. This ini has lost its formatting but it still works fine (The whole text is just one long line.)
I have reformatted it to make it easier to read. This text contains the German special characters öäüÖÄÜß. But they are not displayed in the ini correctly or when called when Webauction is run. I have copied this ini to my application lang directory so that I can build on it. I have edited it using my windows 2000 notepad it supports UTF-8. I have entered Danish and German special characters in the ini and saved it as UTF-8 from the notepad save selection and do not get the correct result when webauction is run.
Special characters entered directly into the php are correctly displayed.
What help can you give me about that Steve?
Best regards,
Tony

PostPosted: Wed Nov 07, 2007 3:05 pm
by shannah
Hi Anthony,

Likely these showed up on one line because they use unix line breaks. Try using a text editor that respects unix line breaks.
It is also imperative that your text editor supports UTF-8 if you want to edit this file. Otherwise all the special characters will get "gummed" up. Despite Notepad's claim to "export as UTF-8", I don't trust notepad for anything important.

One other thing to make sure, however, is that your application's output encoding is set to UTF-8. If it is using ISO-Latin-1 (the default) the special characters will show up gibbled.

You can force UTF-8 by adding
Code: Select all
oe="UTF-8"
ie="UTF-8"

to the beginning of your conf.ini file.

-Steve

UTF-8

PostPosted: Thu Nov 08, 2007 7:25 am
by Anthony Barber
Hi Steve,
Still no luck. Added UTF-8 to the conf.ini as you suggested.
Went to the site you point to in the tutorial to download a UTF-8 editor.
Downloaded AbiWorld and BabelPad. BabelPad does all sorts of things, it even has a browser!!
What BabelPad did do, is it loaded the original german.ini formated. But what surprises me with the original German.ini is that there are no German special characters in it, they are replaced by rubbish i.e. ü in place of ü.
I would expect to see the correct characters in the file. (Or how would one be expected to write it?)
However, I entered my 7 German letters öäüßÖÄÜ and got rubbish out.
I was able to see one piece of logic from the output of the above 7 characters. The output was 14 characters and each character pair started with a capital A with tilde over it.

I think there are two problems here.
a, The original German.ini is not kosher.
b, Webauction is unable to interpret the extended character set from a lang file as it stands.
What do you think?
Best regards,
Tony

Internationalization UTF-8

PostPosted: Thu Nov 08, 2007 9:43 am
by Anthony Barber
Hi Steve,
I can give you some more information about my problem.
My auction site contains Danish coins. Denmark uses special characters æøåÅÆØ. The descriptions of some of my coins contain these letters. I am using IE6.0 as a browser and I am in Germany. The Danish text reads correctly but the fineprint at the bottom of the screen is being automatically translated into German and this output s rubbish. In the conf.ini I have oe="UTF-8" and ie="UTF-8".
Now, when I right click the mouse on the IE screen I get a menu, in the menu is an Encoding tag. The encoding tag is on Automatic selection and is Western European (ISO). If I change this to Unicode UTF-8, I get the German characters in the fineprint. But, I loose my Danish characters in the product description. Also, each page refresh reverts back to the Western European (ISO) with Danish characters in the product description and rubbish in the German translation of the fineprint.
I think that the UTF-8 command in the conf.ini is getting cancelled by some later code. I have done a bit of looking and seen charset =ISO-8859-1. I wondered if that might have something to do with it.
But it looks more complicated than that as I can't have both Danish characters in the database and German special characters on the screen.
What help can you give me on this?
Best regards,
Tony

PostPosted: Thu Nov 08, 2007 1:13 pm
by shannah
Hi Anthony,

Where in the conf.ini file did you add them? The beginning or end?

-Steve

UTF-8

PostPosted: Thu Nov 08, 2007 1:26 pm
by Anthony Barber
Hi Steve,
If you mean UTF-8 I placed it at the beginning as you said.
Under ;debug=1
Tony

UTF-8 More info

PostPosted: Thu Nov 08, 2007 3:40 pm
by Anthony Barber
Hi Steve,
I read in one of the tutorials that one could have a language menu using text or flags and I thought I would see if I could find out how.
In - How to use other translations - It said put the following in your conf.ini

[languages]
en=English
fr="Français"
de="Deutch"
I found this confusing, in double quotes or not?
Well I put it in with double quotes, after my oe="UTF-8"
And I didn't get a language menu but, I did get Danish special characters in the product field and German special characters in the fineprint.

I am quite confused. It would appear that the language statement solved the problem of the special characters. But how should it be written - double quotes or not?
I did put the UTF-8 in without quotes to see what happens and I am not sure, it takes so much testing with the different combinations and refreshes.

So, the language statement solved that part with IE6. With Firefox, it does not do an automatic translation like it does with IE6. So I tried the tip from the above tutorial - How to use other translations. I REM'd out en="English" and da="Danish" and left just de="Deutsch" to force it to translate. It didn't translate.

Can you solve my confusion?
And how do I get the language select widget?
Sorry for being such a pain!!
Best regards,
Tony

Languages

PostPosted: Fri Nov 09, 2007 1:11 pm
by Anthony Barber
Hi Steve,
Could you help me please?
Regards,
Tony

PostPosted: Sat Nov 10, 2007 10:01 am
by shannah
Sorry. Swamped with work..


Try using default_oe and default_ie instead of ie and oe.

e.g.
Code: Select all
default_oe="UTF-8"
default_ie="UTF-8"