0 Replies Latest reply on Jun 17, 2010 3:21 PM by alex485947

    Guestbook doesn't show umlauts (german symbols - Öö, Ää, Üü, ß)

    alex485947

      Hi guys!

       

      My guestbook sends data to PHP, than PHP writes it into an XML, and than Flash takes data from XML. All works correct. But, it doesn't show umlauts (german symbols - Öö, Ää, Üü, ß).

       

      We checked the codes in PHP and they are correct. The PHP scrypt itself writes umlauts in XML. Also we checked loadind data from XML by Flash. It also works fine.

      The only scrypt that has some error (which doesn't send german symbols correct) is the one that sending data from Flash to PHP.

       

       

       

      So, here is AS codes:

       

      1-st code.

       

       

      function view()

      {

          page_num = 1;

          gotoAndPlay("loading");

      }

      function clear()

      {

          name_txt.text = "";

          email_txt.text = "";

          message_txt.text = "";

      }

      function submit()

      {

          page_num = 1;

          name = name_txt.text;

          email = email_txt.text;

          message = message_txt.text;

          gotoAndPlay("sending");

      }

      name_txt.tabIndex = 1;

      email_txt.tabIndex = 2;

      message_txt.tabIndex = 3;

      _root.main_mc.mc_conteiner._visible = false;

      j = 0;

      while (j < myData.page_count)

      {

          if (j < 10)

          {

              names = "0" + j;

          }

          _root.main_mc["mc_page" + names]._visible = false;

          ++j;

      }

      stop();

       

       

       

       

      2-nd code (sends data to php):

       

      randNum = Math.random() * 1000000;

      myData = new LoadVars();

      myData.load("addentry.php?" + randNum + "&name=" + name + "&email=" + email + "&message=" + message, myData, "POST");

      myData.onLoad = function ()

      {

          if (myData.result == "okay")

          {

              gotoAndPlay("loading");

              return;

          }

          gotoAndPlay("view");

      }

      ;

      stop();

       

       

       

       

      3-rd code (takes data from xml, this code is ok):

       

      randNum = Math.random() * 1000000;

      var maxrecord = 5;

      if (!page_num)

      {

          page_num = 1;

      }

      myData = new LoadVars();

      var str:TextField = new TextField();

      var picts_xml = new XML();

      picts_xml.ignoreWhite = true;

      picts_xml.load("guestbook.xml?" + randNum);

      picts_xml.onLoad = function (success)

      {

          if (success)

          {

              myData.result = "okay";

              str = "";

              rootNode = this.firstChild;

              numberOfItem = rootNode.childNodes.length;

              var __reg3 = Math.ceil(numberOfItem / maxrecord);

              if (__reg3 > 10)

              {

                  trace("");

                  maxrecord = Math.ceil(numberOfItem / 10);

                  __reg3 = Math.ceil(numberOfItem / maxrecord);

              }

              var __reg2 = page_num * maxrecord - maxrecord;

              var __reg1 = page_num * maxrecord;

              trace("min" + __reg2 + " max = " + __reg1);

              t = 0;

              while (t < numberOfItem)

              {

                  if (__reg2 <= t && t < __reg1)

                  {

                      str = str + ("<font color=\"#000000\">Name:</font> " + rootNode.childNodes[t].childNodes[0].childNodes[0].nodeValue + "\n");

                      str = str + ("<font color=\"#000000\">Email:</font><font color=\"#CCCCCC\"><u><A href=\"mailto: " + rootNode.childNodes[t].childNodes[1].childNodes[0].nodeValue + "\"> " + rootNode.childNodes[t].childNodes[1].childNodes[0].nodeValue + "</A></u></font><br>\n");

                      str = str + ("<font color=\"#000000\">Posted:</font>" + rootNode.childNodes[t].childNodes[2].childNodes[0].nodeValue + "\n");

                      str = str + ("<font color=\"#000000\">Message:</font> " + rootNode.childNodes[t].childNodes[3].childNodes[0].nodeValue + "\n\n");

                  }

                  myData.entries = str;

                  ++t;

              }

              myData.page_count = __reg3;

              gotoAndPlay("view");

              return;

          }

          trace("");

      }

      ;

      picts_xml.removeNode();

      stop();

       

       

      Thank you for help!

      Alex