PDA

View Full Version : Solved foreign characters when switching between languages



norku
06-04-11, 21:36
Hi,

This thread was posted by a user with German set as his default language:


http://www.xxxxxxxxxx.com/forum/de/f31/hj-messer-böcker-4824/

All good. When I switch the forum to English using the flag and then hover over that link in 'What's New?' I see:


http://www.xxxxxxxxxxx.com/forum/f31/hj-messer-böcker-4824/

Great - until I click on the link. When the page opens I see the following in the browser address bar:


http://www.xxxxxxxxxxxx.com/forum/f31/hj-messer-b%C3%B6cker-4824/

I need German words containing special characters (ö,ä etc) to stay as they are because people searching for my content will use German words in the search string regardless of the language they themselves speak.

What can I do to prevent this foreign character problem chaps? Or am I missing something really obvious? Wouldn't be the first time since I started using Vbet :)

Just for info: in Vbseo I have the following set:

'Replace Non-English Characters in URLs? - no'

'Define your custom character replacements
'ü' => 'ue'
'ä' => 'ae'
'ö' => 'oe'
'ß' => 'ss'
'Ü' => 'Ue'
'Ä' => 'Ae'
'Ö' => 'Oe''

Thanks

kamilkurczak
06-04-11, 21:45
please check this solution:
http://www.vbenterprisetranslator.com/forum/vbet4-troubleshooting/1521-flag-url-incorrect-2.html#post7566
you should declare this redirection ONLY for GERMAN letters!
polish letters (and of course another languages too) it works good so make this replacement only for german letters.

norku
06-04-11, 21:52
Hi Kamil,

I haven't changed anything since we last worked on this. I amended my post above to show how vbseo is currently set for foreign characters. The only thing I've done recently is to update Vbulletin with the security patch.

norku
06-04-11, 22:32
Just testing this. The problem appears to be caused by place names, names - basically terms which Google would not translate.

The following link is as it appears to a German user:


http://www.xxxxxxxxx.com/forum/de/f80/fuß-mütze-ätzend-düren-björn-4827/

click on the English flag and the same link looks like this:


http://www.xxxxxxxxxxx.com/forum/f80/foot-hat-corrosive-d%FCren-bj%F6rn-4827/

Vbseo character replacement doesn't appear to handle any language other than the forum default when vbet is installed.

kamilkurczak
07-04-11, 10:38
hello,

Ok i can reproduce it, so I will solve it on my test forum.

As I see the problem is only with words which are untranslatable (names etc. like Düren and Björn)

Confirmed and will be solved!

norku
07-04-11, 13:33
Thanks Kamil :)

norku
08-04-11, 17:09
Any progress on this one Kamil?

kamilkurczak
08-04-11, 19:04
hello,
still working on it. thanks for your patience.
We will write here all solution:)
thanks

norku
08-04-11, 19:24
Cool. Thanks Kamil.

vBET
04-05-11, 13:20
Hello. I just started working on it and after some analyze I realized that there is no bug at all... I will still check possibility of changing the behavior, now here is explanation what happens:
- your translated pages are in UTF-8 so browsers shows special characters from URL in nice way (excluding IE which do not honor this standard)
- your original pages are not un UTF-8 so browser do not display special characters in nice way and vBET do not changes URLs for not translated pages

I will check how it will behave if vBET re-encode URL even for not translated page - I cannot predict it because page encoding and URL encoding will differ. If it will help I will give you quick fix and probably will not include it in official release (or configurable - need to check first results and think about possible effects). If it will not help it will stay as it is because it is browser display issue (just like IE do not shows special characters in nice way at all - maybe newest does it didn't check it).

I will give you feedback in few moments.

vBET
04-05-11, 14:24
OK so - I know exactly what is going on now. Described behavior is intended. In case of original pages vBET encodes URLs to safe UTF-8 - otherwise you would see broken characters on your forum page. It is because when you show string in other encoding that is the page then it will be decoded in wrong way - so you see broken characters. That is why in vbenterprisetranslator_functions_bbcode.php we have this code:


if (!$_REQUEST['language'] && vB_Template_Runtime::fetchStyleVar('charset') != 'utf-8') {
$translated = vbet_encodeToSafeUTF8($translated);
}

If you comment it then you will see nice URL in browser on not translated page with special characters, but those special characters will be broken on forum page. The issue is that vBSEO do not allows to recognize which URL generation is for page and which for browser URL. So we are not able to encode to safe UTF-8 only for URLs to view and leave as it is for broswer. It is vBSEO API limitation and it have to stay this way. This is not a bug - this is indented feature which allows to have nice view with special characters on not translated limited by vBSEO API which makes requests for URL rendering.

At this moment issue closed. If you have some comments, ideas, questions - just feel free to write :) We can reopen it if some crucial information will appear. I also move it to troubleshooting section as it is not recognized as bug.

AfrikaansAlbanianArabicBelarusianBulgarianCatalanChineseCroatianCzechDanishDutchEnglishEstonianFilipinoFinnishFrenchGalicianGermanGreekHaitian CreoleHebrewHindiHungarianIcelandicIndonesianIrishItalianJapaneseKoreanLatvianLithuanianMacedonianMalayMalteseNorwegianPersianPolishPortugueseRomanianRussianSerbianSlovakSlovenianSpanishSwahiliSwedishTaiwaneseThaiTurkishUkrainianVietnameseWelshYiddish
Translations supported by vBET Translator 4.9.2