Important: This page is using cookies (cookies). Using this website without turning off cookies in browser, means that you agree for using it.
Buy Now! Features Downloads

Earn with us!

If you would like to start earning money with vBET join to Affiliate Program.
Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: Accents not displaying correctly...

  1. #1
    Junior Member
    Join Date
    Feb 2011
    Posts
    9

    Default Accents not displaying correctly...

    Hi.

    I'm using vbulletin 4.08.

    I use vbet for mainly two languages... English and French. I have the forum default language set to English. However, whenever a French user posts, the translation displays correctly in English. However, in French the accents do not display. Instead, it displays like this:

    Code:
    Dans quelle langue vous allez & #233;crire vos messages. Forum traduira automatiquement vos messages & #224; d'autres utilisateurs langues. En outre, il se traduira par des postes dans d'autres langues & #224; votre langue par d& #233;faut.
    It should display like this:

    Code:
    Dans quelle langue vous allez écrire vos messages. Forum traduira automatiquement vos messages à d'autres utilisateurs langues.
    My forum is set up to display both languages as ISO-8859-1. Therefore, I am not using UTF-8

    Also, I followed the installation instructions very closely.

    The only modification I made to vBet is that I changed the default flags using CSS-Sprite. However, I looked at the code, and nothing I did should effect the way that things are being displayed.

    Do I have to convert my db to UTF-8 to solve this problem?

    Any advice will be appreciated. Thanks.
    Last edited by freddie3218; 07-03-11 at 16:12. Reason: I edited the original quote, because this forum displayed it correctly. I added a space in the "& #233" fields.

  2. #2
    Junior Member
    Join Date
    Feb 2011
    Posts
    9

    Default

    Well.... I disabled every other plugin, and I still have the same problem. Looks like a bug in vbet

  3. #3
    vBulletin Enterprise Translator (vBET) Staff
    Join Date
    May 2010
    Posts
    1,000

    Default

    hello, do you use UTF-8 forum and database or not?
    If not - I should have a solution for you. I wil prepare it and write here.

    If you can - please paste here a url to the thread with this issue.
    Thanks

  4. #4
    Junior Member
    Join Date
    Feb 2011
    Posts
    9

    Default

    Quote Originally Posted by kamilkurczak View Post
    hello, do you use UTF-8 forum and database or not?
    If not - I should have a solution for you. I wil prepare it and write here.

    If you can - please paste here a url to the thread with this issue.
    Thanks
    No, I do not use a UTF-8 forum or database. I use ISO-8859-1.

    You can see the problem live by viewing this thread:

    $ 1 This is a test

    Thanks.

  5. #5
    Junior Member
    Join Date
    Feb 2011
    Posts
    9

    Default

    Any news on what is causing it?

  6. #6
    vBulletin Enterprise Translator (vBET) Staff
    Join Date
    May 2010
    Posts
    1,000

    Default

    hello,

    I am testing it on my test forum (in not UTF) and I can't to reproduce it but you can try this solution.
    I have something for you:
    1. open, make a copy and edit this file:
    forum root/includes/vbenterprisetranslator_functions_utils.php
    2. in this function find:
    PHP Code:
    function vbet_encodeToSafeUTF8(&$string) {
            
    //TODO how to check does utf-8 is involved? how often this function is used?
    //        if (! ereg('[\200-\237]', $string) and ! ereg('[\241-\377]', $string)) 
    //        if (!preg_match('/[\200-\237]/', $string) and !preg_match('/[\241-\377]/', $string)) 
    //        if (!preg_match('/[\200-\237\241-\377]/e', $string)) 
    //            return $string; 
        
            // decode three byte unicode characters 
            
    $string preg_replace('/([\340-\357])([\200-\277])([\200-\277])/e',        
                    
    '\'&#\'.((ord(\'\\1\')-224)*4096 + (ord(\'\\2\')-128)*64 + (ord(\'\\3\')-128)).\';\'',    
                    
    $string); 
        
            
    //decode two byte unicode characters 
            
    $string preg_replace('/([\300-\337])([\200-\277])/e'
                    
    '\'&#\'.((ord(\'\\1\')-192)*64+(ord(\'\\2\')-128)).\';\''
                    
    $string); 
                        
            return 
    $string;
        } 
    3. and comment all lines without return like this one:
    PHP Code:
    function vbet_encodeToSafeUTF8(&$string) {
            
    //TODO how to check does utf-8 is involved? how often this function is used?
    //        if (! ereg('[\200-\237]', $string) and ! ereg('[\241-\377]', $string)) 
    //        if (!preg_match('/[\200-\237]/', $string) and !preg_match('/[\241-\377]/', $string)) 
    //        if (!preg_match('/[\200-\237\241-\377]/e', $string)) 
    //            return $string; 
        
            // decode three byte unicode characters 
          //  $string = preg_replace('/([\340-\357])([\200-\277])([\200-\277])/e',        
            //        '\'&#\'.((ord(\'\\1\')-224)*4096 + (ord(\'\\2\')-128)*64 + (ord(\'\\3\')-128)).\';\'',    
                //    $string); 
        
            //decode two byte unicode characters 
            //$string = preg_replace('/([\300-\337])([\200-\277])/e', 
            //        '\'&#\'.((ord(\'\\1\')-192)*64+(ord(\'\\2\')-128)).\';\'', 
            //        $string); 
                        
            
    return $string;
        } 
    4. save and test!

    this should work only for new posts. all existing posts you should edit by hand.
    I not shure that you have a ISO forum but you can test it. If not good - please overwrite these changes bu old file

  7. #7
    Junior Member
    Join Date
    Feb 2011
    Posts
    9

    Default

    Hi,

    That was a good try. However, it does not work.

    The output now shows: "Ceci est un test. S'il vous plaît ignorer ce message."

    The correct output should be: "Ceci est un test. S'il vous plaît ignorer ce message."

    Therefore, I reverted back.

    Here is one thing I noticed:

    When posting and editing, it does not display correctly. However, if I hit the WYSIWYG editor button to go into "basic mode", then it WILL display correctly in the WYSIWYG editor. However, when I try to save it, it reverts to showing incorrectly again. It seems that the WYSIWYG editor is not parsing things correctly before saving when I'm using VBET in a foreign language, or when I'm using the [lang= ] tags. However, if I post a foreign phrase without using the [lang=fr] tags, then it will display correctly when saving. So it seems that VBET is not allowing the WYSIWYG editor to parse correctly before saving... if that makes any sense.

  8. #8
    vBulletin Enterprise Translator (vBET) Staff
    Join Date
    May 2010
    Posts
    1,000

    Default

    you have this issue when you would like to post on translated page or not? please describe what i should do to have the same results on my test forum.

  9. #9
    Junior Member
    Join Date
    Feb 2011
    Posts
    9

    Default

    Quote Originally Posted by kamilkurczak View Post
    you have this issue when you would like to post on translated page or not? please describe what i should do to have the same results on my test forum.
    I don't know if you can reproduce this on your forum or not. However, this is what happens:

    Vbulletin version 4.08
    I have two languages on my site: English and French. I disabled all other languages, and all other flags.
    All English and French is translated throughout the site properly, with the proper accents. The only time the accents do not display properly is if someone is using the French language and posts in French... having the "French language" chosen in their user profile. In this case, VBET will assign the proper BBcode tags automatically when they post. IE: "[lang=fr]" However, once they submit their post, the accents on their post will NOT appear properly. If they press the "edit post" button, they will see their post in the advanced WYSIWYG editor displayed improperly (I have all accounts set up to use the WYSIWYG editor, even in quick reply, by default so that all users can attach pictures from their hard-drive). However, if they toggle the "switch editor mode" button back and forth, they will see their post appear properly. Yet, when they try to save the changes to their post, it will once again display improperly when they save their post.

    This problem only happens when the user is using the "FRENCH LANGUAGE" in their user profile settings and posting in the French language... thus making vbet add the [lang=fr] to a post automatically.

    My forum default language is English.

    If you need to take a look around on my forum... pm me, and I will send you the necessary information to check out my admin panel setup.

    I hope this information is helpful.

    Thanks.

  10. #10
    vBulletin Enterprise Translator (vBET) Staff
    Join Date
    May 2010
    Posts
    1,000

    Default

    yes. I can confirm it on my test forum!
    This is a vBET bug so I need to move this thread into bug reporting section.

    I noticed that there is a encoding issue with letters with ASCII code under &#256

    I can reproduce it on my test forum so I can fix it without access to your forum

    I will try to find the best solution for you.
    Last edited by kamilkurczak; 11-03-11 at 11:40.

Page 1 of 2 12 LastLast

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •