CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Regular Expressions:
Issue with special characters in Perl

 



dibyendu
New User

Apr 10, 2009, 1:44 AM

Post #1 of 3 (2167 views)
Issue with special characters in Perl Can't Post

 
Am getting some special characters in my browser displayed weirdly, while getting them from from the BLOB of a DB table.

Here it is :

Quote

Code
" My name is � Dibyendu Chatterjee �....."



I want all special characters pulled from the BLOB as it is through perl.

Please help...


(This post was edited by dibyendu on Apr 10, 2009, 2:43 AM)


PGScooter
stranger

Apr 20, 2009, 9:52 AM

Post #2 of 3 (2081 views)
Re: [dibyendu] Issue with special characters in Perl [In reply to] Can't Post

hi dibyendu,

I think it would really help if you posted your code!

Just a newbie guess, but are you pulling something from a hash that contains an array but are referring to it as if it contained a string? You could always use a regex to get rid of the junk, but it seems like a better idea to attack the problem at its source.
The more you teach me, the more I learn. The more I learn, the more I teach.


Shree
Novice


Apr 22, 2009, 12:36 AM

Post #3 of 3 (2065 views)
Re: [dibyendu] Issue with special characters in Perl [In reply to] Can't Post

#!/usr/bin/perl
use strict;
use warnings;

my $str = "My name is � Dibyendu Chatterjee �.....";
my $specail_characters = $str;

$specail_characters =~ s/[^\&|\#|\;|\.]//g;

print $specail_characters;

Code
 
Output: &#;&#;.....



Quote
Thanks
-Shree


 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives