Question: How to deal with non ASCII characters (German letters)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Question: How to deal with non ASCII characters (German letters)

    I am working in a website containing German language, and there is many data to store in database (MySQL).

    They gave me a database dump which I imported; but there are some German letters like "ä, ö, ü" stored in LONGTEXT fields and I am not being able to display them correctly.
    Any suggestion?

    Thank you!
    mysterio.al - programming is a functional art

    #2
    add after line sql connect this

    mysql_query('SET NAMES \'utf8\'');

    and make tables in phpmyadmin character utf-8

    Comment


      #3
      header("Content-type: text/html; charset=latin1");

      ALTER TABLE `table` DEFAULT CHARACTER SET=latin1;

      Comment


        #4
        Thank you guys! Will try both cases and tell you!
        mysterio.al - programming is a functional art

        Comment


          #5
          as far as im aware utf8 doesnt support ä, ö, ü etc

          Comment


            #6
            Originally posted by something else View Post
            as far as im aware utf8 doesnt support ä, ö, ü etc
            utf supports öäü and cyrillic and other symbols too.
            Unicode/UTF-8-character table
            if you make a site which should support multilanguage symbols, you have to set utf-8 enconding for your mysql tables.
            Advertise your mobile site for FREE with AdTwirl

            Comment


              #7
              It was not helping to change encoding of the table fields, until I switched to "Content-type: text/html; charset=latin1"

              This seems to be a solution!

              Thank you!
              mysterio.al - programming is a functional art

              Comment


                #8
                Originally posted by Mysterio3 View Post
                It was not helping to change encoding of the table fields, until I switched to "Content-type: text/html; charset=latin1"

                This seems to be a solution!

                Thank you!
                when u change mysql charset also change page charset too.

                Comment


                  #9
                  Yes, thanks!

                  I was getting confuse because UTF-8 or UTF-16 was not working, while latin1 did the job without touching database!
                  That was my aim.
                  mysterio.al - programming is a functional art

                  Comment


                    #10
                    Originally posted by Mysterio3 View Post
                    Yes, thanks!

                    I was getting confuse because UTF-8 or UTF-16 was not working, while latin1 did the job without touching database!
                    That was my aim.
                    well... UTF-8 should work as well
                    and it would be more appropriate
                    for special chars like ä, ö, ü etc,
                    also chars like č, ć, đ, š, ž, etc
                    it just take a bit more time to figure it out
                    It's better to keep your mouth shut and give the impression that you're stupid, than to open it and remove all doubt.
                    ⓣⓗⓔ ⓠⓤⓘⓔⓣⓔⓡ ⓨⓞⓤ ⓑⓔ©ⓞⓜⓔ, ⓣⓗⓔ ⓜⓞⓡⓔ ⓨⓞⓤ ⓐⓡⓔ ⓐⓑⓛⓔ ⓣⓞ ⓗⓔⓐⓡ !
                    ιη тнєσяу, тнє ρяα¢тι¢є ιѕ α яєѕυℓт σƒ тнє тнєσяу, вυт ιη ρяα¢тι¢є ιѕ тнє σρρσѕιтє.
                    キノgんイノ刀g 4 ア乇ムc乇 ノ丂 レノズ乇 キucズノ刀g 4 √ノ尺gノ刀ノイリ!

                    Comment


                      #11
                      That what i was tryna say. Just cuz latin worked dnt mean its ok.

                      Comment

                      Working...
                      X