How to specify the connection charset in config.php ?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mihai11
    Senior Member
    • Dec 2005
    • 398
    • 3.6.x

    How to specify the connection charset in config.php ?

    Hi,



    I created a database with the charset "utf8_general_ci". I see that config.php file has a line like this:

    Code:
    // $config['Mysqli']['charset'] = 'utf8';
    Should I just uncomment the line ? Or should I clearly specify which charset to use (e.g. utf8_general_ci).

    To be more clear, do I need to write:

    Code:
    $config['Mysqli']['charset'] = 'utf8';
    or

    Code:
    $config['Mysqli']['charset'] = ' utf8_general_ci';
    Please clarify.


    Regards,
    Razvan
  • Steve Machol
    Former Customer Support Manager
    • Jul 2000
    • 154488

    #2
    Do you have any problems? If not, then I would leave this alone.
    Steve Machol, former vBulletin Customer Support Manager (and NOT retired!)
    Change CKEditor Colors to Match Style (for 4.1.4 and above)

    Steve Machol Photography


    Mankind is the only creature smart enough to know its own history, and dumb enough to ignore it.


    Comment

    • mihai11
      Senior Member
      • Dec 2005
      • 398
      • 3.6.x

      #3
      There can be problems if I don't understand how it works.

      The requirements is to use this charset (utf8_general_ci). I need to know how to correctly inform VB about the charset used in the database.

      Comment

      • Steve Machol
        Former Customer Support Manager
        • Jul 2000
        • 154488

        #4
        Either you are having problems on your forums after making this change or not. Are you?
        Steve Machol, former vBulletin Customer Support Manager (and NOT retired!)
        Change CKEditor Colors to Match Style (for 4.1.4 and above)

        Steve Machol Photography


        Mankind is the only creature smart enough to know its own history, and dumb enough to ignore it.


        Comment

        • mihai11
          Senior Member
          • Dec 2005
          • 398
          • 3.6.x

          #5
          I am speaking about a new forum - without any posts.

          Comment

          • mihai11
            Senior Member
            • Dec 2005
            • 398
            • 3.6.x

            #6
            Originally posted by Steve Machol
            Either you are having problems on your forums after making this change or not. Are you?
            Well, now I am having problems. Too bad you didn't took the time to explains how this works from the first time.

            When entering some very common characters in a forum post, the post gets truncated. For example the character "»" cuts the text at the position where the character is entered. There are several other common used characters that have the same effect. How do I fix this ?

            Comment

            • Scott MacVicar
              Former vBulletin Developer
              • Dec 2000
              • 13286

              #7
              utf8_general_ci is a collation, not a charset. You would simply use utf8.

              Though you need to have PHP 5+ and use MySQLi.

              Steve was correct in telling you not to change it if you want have an issue, you can do more damage by setting an incorrect charset.
              Scott MacVicar

              My Blog | Twitter

              Comment

              • mihai11
                Senior Member
                • Dec 2005
                • 398
                • 3.6.x

                #8
                Originally posted by Scott MacVicar
                utf8_general_ci is a collation, not a charset. You would simply use utf8.
                (I) Please tell me where to read more about the difference between a "collation" and a "charset" ?

                Though you need to have PHP 5+ and use MySQLi.
                These requirements are fulfilled.

                I need to make this clear. If I go to PHPMYADMIN I have the following options when creating a database: (collation as you said)

                utf8_bin
                utf8_czech_ci
                utf8_danish_ci
                utf8_esperanto_ci
                utf8_estonian_ci
                utf8_general_ci
                utf8_hungarian_ci
                utf8_icelandic_ci
                utf8_latvian_ci
                utf8_lithuanian_ci
                utf8_persian_ci
                utf8_polish_ci
                utf8_roman_ci
                utf8_romanian_ci
                utf8_slovak_ci
                utf8_slovenian_ci
                utf8_spanish2_ci
                utf8_spanish_ci
                utf8_swedish_ci
                utf8_turkish_ci
                utf8_unicode_ci
                (II) Can I use UTF8 for all the above options ? (I don't have to modify anything in config.php file)

                Comment

                • Floris
                  Senior Member
                  • Dec 2001
                  • 37767

                  #9
                  MySQL has some information about this:

                  Comment

                  • mihai11
                    Senior Member
                    • Dec 2005
                    • 398
                    • 3.6.x

                    #10
                    Originally posted by Floris
                    MySQL has some information about this:
                    http://dev.mysql.com/doc/refman/5.0/en/charset.html

                    Thanks.

                    Comment

                    Related Topics

                    Collapse

                    Working...