Welcome, Guest. Please login or register.
Did you miss your activation email?
05/23/12, 01:59
Home Help Search Login Register
News: Parsley Flex framework review featuring quiz application, in our Flex frameworks series
Flex SDK 4.5 mobile roadmap: begin with your mobile development
Swiz Flex framework review featuring quiz application
New homepage we release our new Homepage, take a look ...

+  Flash-db
|-+  Recent Tutorial Support
| |-+  Flash GuestBook Support (Moderators: Flash-db, vesa kortelainen, Ronald Wernecke, Mohsin Sumar, Jorge Solis)
| | |-+  Foriegn Languages Input?
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Print
Author Topic: Foriegn Languages Input?  (Read 2602 times)
a
Server what's that
*
Posts: 20



View Profile Email
« on: 02/19/04, 06:32 »

Hi,
    I was wondering if this guestbook would support non-English languages.  I am able to cut and paste Chinese into the text fields, but, whenever I try to type in there, the Chinese turn into some random codes. BUT, they will show up fine once it's submitted.  Is there a way to fix this??

thanks in advance,

Al
Logged
Ronald Wernecke
Administrator
Systems Administrator
*****
Posts: 6175


View Profile WWW Email
« Reply #1 on: 02/19/04, 08:04 »

Hi,
you have to decode the strings before you enter them into the text file.
After you read them, you have to encode them again bfore you send them to flash.

Use utf8_decode/utf8_encode function in you php script
Logged

happy flashing
Cool
Ronald
a
Server what's that
*
Posts: 20



View Profile Email
« Reply #2 on: 02/19/04, 08:07 »


Hi,
you have to decode the strings before you enter them into the text file.
After you read them, you have to encode them again bfore you send them to flash.

Use utf8_decode/utf8_encode function in you php script


Ronald,
     thanks for the reply. I think I've ran into that quote during my search, however, being a php retard and all, I have no idea what to do with the code. Can you please be a little more specific??

Al
Logged
a
Server what's that
*
Posts: 20



View Profile Email
« Reply #3 on: 02/19/04, 08:17 »

actually, Ronald

     The problem is not sending or receiving the chinese characters, but is when typing them.  Is the problem still with the way i string?

Al
Logged
Ronald Wernecke
Administrator
Systems Administrator
*****
Posts: 6175


View Profile WWW Email
« Reply #4 on: 02/19/04, 08:24 »

Hi,
if you look around this board, especialy this section, you'll find lots of articles about it.

Flash automaticly encodes the strings with utf8. Before you insert them, you do
utf8_decode(variable).

After most php installations have globals off, you have to retch them anyway.

So it makes sense to write something like this:

$textfield1=utf8_decode($_POST["textfield1"]);
...
until you have all your fields fetched.

Before you send info to flash, you have to encode it.

so at the end of the procedure you write:

echo utf8_encode($returnstring);
Logged

happy flashing
Cool
Ronald
a
Server what's that
*
Posts: 20



View Profile Email
« Reply #5 on: 02/19/04, 09:13 »

Ronald,
    here is what I've changed to my php file:
Code:

$Submit = utf8_decode($_POST["Submit"]);
$Name = utf8_decode($_POST["Name"]);
$Email = $_POST["Email"];
$Website = $_POST["Website"];
$Comments = utf8_decode($_POST["Comments"]);
$NumLow    = $_REQUEST["NumLow"];
$NumHigh    = $_REQUEST["NumHigh"];

does that look about right?

Umm...where should I insert this code:
Code:
echo utf8_encode($returnstring);


sorry, I did a search, but didn't quite understand what people were talking about...

Al
Logged
Ronald Wernecke
Administrator
Systems Administrator
*****
Posts: 6175


View Profile WWW Email
« Reply #6 on: 02/19/04, 12:36 »

instead of echoing each line, collect them into one string and send this back at once.
You can utf8_encode every line. But it looks more clean, if you do it on one space Wink
Logged

happy flashing
Cool
Ronald
Pages: [1] Print 
« previous next »
Jump to:  


Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!