Jump to content

Language problem on mobile devices


DavideTS

Recommended Posts

Hello masters.

I wish to share with you a problem that is killing me in this dais!! I have a website in xhtml, with some php form. This website is made for Japanese customers (all in Japanese) and that's the big trouble. The language encoding of the php form is really killing me. I tried several solutions, but I couldn't sort this problem. So I was wondering if you guis could help me... :'(

 

This is how it should work: customers fill up the form in Japanese. The php script send the deta to my mail address and to the customer one. Simply and plan. No image, just text ... easy. I tested it on my Japanese computer and it works great: I recive the mail, the customer recive the mail and all the field are ok and I can read all the Japanese charachters. The big troubles come out when I try to fill up the form with a Japanese mobile device: Both the customer and me recive a mail with weird characters. something like this: ..????i???.... and so on....damn, I can't understand why. The most weird thing is that it really works great on computer browser. But as this is a website for mobile devices I have no choice but to settle this. Here is part of the code I use for the form:

 

<?php

// I set the page encoding to EUC-JP and set the Japanese language

mb_language("ja");
mb_internal_encoding("EUC-JP");

// Declare $

$EmailFrom = Trim(stripslashes($_POST['EmailFrom'])); 
$EmailTo = "orders@mobile-body-ex.com";
$Subject = "Body-ex Cellphone Order";
$Nome = Trim(stripslashes($_POST['Nome'])); 
$Cognome = Trim(stripslashes($_POST['Cognome'])); 
$Postal = Trim(stripslashes($_POST['Postal'])); 
$Address = Trim(stripslashes($_POST['Address'])); 
$Number = Trim(stripslashes($_POST['Number'])); 

....

// validation
$validationOK=true;
if (Trim($EmailFrom)=="") $validationOK=false;
if (!$validationOK) {
  print "<meta http-equiv=\"refresh\" content=\"0;URL=error.xhtml\">";
  exit;
}

// prepare email body text

$Body = "モバイルサイトから注文受けました: Angel スリーラウンドペンダント AD-0011 Booking Form;";
$Body .= "名前: ";
$Body .= $Nome;
$Body .= "\n";
$Body .= "名前(フリガナ): ";
$Body .= $Cognome;
$Body .= "\n";
$Body .= "郵便番号: ";
$Body .= $Postal;
$Body .= "\n";
$Body .= "住所: ";

.....

// send email 

$success = mb_send_mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>");

.....Follow the second mail directed to the customer email address. 

 

ps: &#12514;&#12496; are Japanese characters...

 

Both the html page with the form and the php page are set to EUC-JP (charset="euc-jp"). What should I do to make this work properly?  :confused:

I repeat that it actually works on the net if you use a computer browser (try to see at http://www.mobile-body-ex.com/ora1.html). But I couldn't find a way to make it works if you fill up the form trough a browser for mobile devices (Japanese). ......please, give me some hint :rtfm:

Thank you everybody!

 

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.