Page 1 of 1

Greek Omega deleted at the end of the String...

Posted: Thu May 18, 2006 5:44 am
by ametsi
Pimptastic | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


I am using a "C" executable in order to retrieve the nickname of a particular user from a database. The "C" executable returns the nickname correctly. The PHP code prints later the variable "nickname" correctly. However I observed that if the end of the returned "C" output contains one or more Omega Greek characters, then it seems that value which is assigned to the "nickname" variable contains all returned characters except the Omega characters at the end of the string!... Note that if e.g. an Omega character exists inside the returned string (i.e. not at the end of the string), is not deleted... Keep in mind that the "C" program runs ok. That is, running it with Omega at the end, the output is ok. In the following part of the code, the zlog is a method for logging / output.

Code: Select all

$thecommand = "getUsernameC " . $thesender ;
   $nickname = system($thecommand) ;
 
   if (strlen($nickname) > 1)
   {
      zlog("Msisdn: $thesender is registered...Continue processing") ;
 
      zlog("The nickname is $nickname") ;
 
      $userOk = 1 ;
   }
Pimptastic | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]

Posted: Thu May 18, 2006 7:15 am
by Chris Corbyn
Are you sure it's being deleted an not that maybe your browser is just refusing to render it? Check your HTML source. Also run htmlentities() over the output before displaying it in a browser.