<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=windows-1252"
 http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
The Auto Translate module - <a class="moz-txt-link-freetext" href="http://drupal.org/project/i18n_auto">http://drupal.org/project/i18n_auto</a> -
translates content in a text form, so that editors may translate
content before a node is submitted. It currently has the same bug
you're describing, although that should be fixed soon (already fixed in
PHP5, but not yet for PHP4). Also, the module has several GHOP tasks,
visible from <a class="moz-txt-link-freetext" href="http://drupal.org/project/issues/i18n_auto">http://drupal.org/project/issues/i18n_auto</a> - to bring the
module out of development. It will ultimately support other translation
services besides Google as well.<br>
<br>
Aaron Winborn<br>
<br>
Idan Arbel wrote:
<blockquote
 cite="mid8640eb430801120944x7df5c026r5d0ada889b45edbe@mail.gmail.com"
 type="cite">thanks, but I want the translated content to be saved as
nodes, and not to be translated on the fly.<br>
  <br>
Idan<br>
  <br>
  <div class="gmail_quote">On Jan 12, 2008 7:43 PM, Amr Mostafa &lt;<a
 href="mailto:amr.mostafa@gmail.com">
amr.mostafa@gmail.com</a>&gt; wrote:<br>
  <blockquote class="gmail_quote"
 style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hello
Idan,<br>
    <br>
I would like to point out that there is an existing module which does
exactly what you described, it's called gtrans.
    <br>
    <br>
    <a href="http://drupal.org/project/gtrans" target="_blank">http://drupal.org/project/gtrans
    </a><br>
    <font color="#888888"><br>
- Amr</font>
    <div>
    <div class="Wj3C7c"><br>
    <br>
    <div class="gmail_quote">On Jan 12, 2008 7:30 PM, Idan Arbel &lt;<a
 href="mailto:idan@arbel-designs.com" target="_blank">idan@arbel-designs.com
    </a>&gt; wrote:<br>
    <blockquote class="gmail_quote"
 style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
      <div link="blue" vlink="purple" lang="EN-US">
      <div dir="rtl">
      <p dir="ltr" style="text-align: left; direction: ltr;"><font
 face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;">Hello,</span></font></p>
      <p dir="ltr" style="text-align: left; direction: ltr;"><font
 face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;"> </span></font></p>
      <p dir="ltr" style="text-align: left; direction: ltr;"><font
 face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;">I'm
working on a module to auto translate nodes on my websites. I'm using
google
translate to do this.</span></font></p>
      <p dir="ltr" style="text-align: left; direction: ltr;"><font
 face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;"> </span></font></p>
      <p dir="ltr" style="text-align: left; direction: ltr;"><font
 face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;">I've
encountered a problem that I was hoping someone would have an idea how
to solve….when
I translate a text that has "special characters", mainly those that
aren't
English, and I try to display them, I get characters that are black
diamonds. When
trying to display those using drupal with drupal set message, something
strange
happens, it seems like drupal just ignores the entire function. I'm
trying to
print it out of a nodeapi hook, and the when I do all the other
drupal_set_messages aren't displayed, even those that come before. </span></font></p>
      <p dir="ltr" style="text-align: left; direction: ltr;"><font
 face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;"> </span></font></p>
      <p dir="ltr" style="text-align: left; direction: ltr;"><font
 face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;">Anyway,
I think I've isolated the problem to the encoding of the characters,
but I
don't know how to solve it. I see the characters with the black
diamonds when I
print_r($translation), in this case I only see them. And when ever I
try to drupal_set_message
them I don't see anything. </span></font></p>
      <p dir="ltr" style="text-align: left; direction: ltr;"><font
 face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;"> </span></font></p>
      <p dir="ltr" style="text-align: left; direction: ltr;"><font
 face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;">If
I translate a text that doesn't have one of those characters, all is
well.</span></font></p>
      <p dir="ltr" style="text-align: left; direction: ltr;"><font
 face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;"> </span></font></p>
      <p dir="ltr" style="text-align: left; direction: ltr;"><font
 face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;">This
is what I'm using to translate the texts:</span></font></p>
      <p dir="ltr" style="text-align: left; direction: ltr;"><font
 face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;"> </span></font></p>
      <p dir="ltr" style="text-align: left; direction: ltr;"><font
 face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;"> </span></font></p>
      <p dir="ltr" style="text-align: left; direction: ltr;"><font
 face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;">function
google_translate($text, $from = 'en', $to = 'es') {</span></font><font
 face="Arial" size="2"><span dir="rtl"
 style="font-size: 10pt; font-family: Arial;" lang="HE"></span></font></p>
      <p dir="ltr" style="text-align: left; direction: ltr;"><span
 dir="ltr"></span><font face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;"><span dir="ltr"></span> 
$data = "h1=en&amp;ie=UTF8&amp;text=$text";
      </span></font><font face="Arial" size="2"><span dir="rtl"
 style="font-size: 10pt; font-family: Arial;" lang="HE"></span></font></p>
      <p dir="ltr" style="text-align: left; direction: ltr;"><span
 dir="ltr"></span><font face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;"><span dir="ltr"></span> 
$result = drupal_http_request(I18N_AUTO_GOOGLE_TRANSLATE_TRANSLATOR_URL
. '?langpair='. $from .'|'. $to, array(), 'POST', $data);</span></font><font
 face="Arial" size="2"><span dir="rtl"
 style="font-size: 10pt; font-family: Arial;" lang="HE"></span></font></p>
      <p dir="ltr" style="text-align: left; direction: ltr;"><span
 dir="ltr"></span><font face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;"><span dir="ltr"></span> 
$texttosearch = "id=result_box";
      </span></font><font face="Arial" size="2"><span dir="rtl"
 style="font-size: 10pt; font-family: Arial;" lang="HE"></span></font></p>
      <p dir="ltr" style="text-align: left; direction: ltr;"><span
 dir="ltr"></span><font face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;"><span dir="ltr"></span> 
$start = strpos($result-&gt;data,
$texttosearch);</span></font><font face="Arial" size="2"><span dir="rtl"
 style="font-size: 10pt; font-family: Arial;" lang="HE"></span></font></p>
      <p dir="ltr" style="text-align: left; direction: ltr;"><span
 dir="ltr"></span><font face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;"><span dir="ltr"></span> 
$end = strpos($result-&gt;data,
"&lt;/div&gt;", $start+24);</span></font><font face="Arial" size="2"><span
 dir="rtl" style="font-size: 10pt; font-family: Arial;" lang="HE"></span></font></p>
      <p dir="ltr" style="text-align: left; direction: ltr;"><span
 dir="ltr"></span><font face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;"><span dir="ltr"></span> 
$start = $start + 24;</span></font><font face="Arial" size="2">
      <span dir="rtl" style="font-size: 10pt; font-family: Arial;"
 lang="HE"></span></font></p>
      <p dir="ltr" style="text-align: left; direction: ltr;"><span
 dir="ltr"></span><font face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;"><span dir="ltr"></span> 
$translated = substr($result-&gt;data,
$start, $end-$start);</span></font><font face="Arial" size="2"><span
 dir="rtl" style="font-size: 10pt; font-family: Arial;" lang="HE"></span></font></p>
      <p dir="ltr" style="text-align: left; direction: ltr;"><span
 dir="ltr"></span><font face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;"><span dir="ltr"></span> 
return $translated;</span></font></p>
      <p dir="ltr" style="text-align: left; direction: ltr;"><font
 face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;">}</span></font></p>
      <p dir="ltr" style="text-align: left; direction: ltr;"><font
 face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;"> </span></font></p>
      <p dir="ltr" style="text-align: left; direction: ltr;"><font
 face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;">Thanks</span></font></p>
      <p dir="ltr" style="text-align: left; direction: ltr;"><font
 face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;"> </span></font></p>
      <p dir="ltr" style="text-align: left; direction: ltr;"><font
 face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;">Idan</span></font></p>
      </div>
      </div>
    </blockquote>
    </div>
    <br>
    </div>
    </div>
  </blockquote>
  </div>
  <br>
</blockquote>
<br>
</body>
</html>