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

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ametsi
Forum Newbie
Posts: 1
Joined: Thu May 18, 2006 5:32 am

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

Post 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]
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post 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.
Post Reply