How to remove characters from a line - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

How to remove characters from a line

Federal101Federal101 Posts: 36Member
I have an xml file that has been edited by someone using a French keyboard.

Somehow the file ended up with the characters i>>? (except the question mark is upside down) at the beginning of the file. The characters are invisible, I cannot see them with any text editor that I have tried. They only show up if I diff the file against a US version.

My questions are -

1. Does anyone know what these charaters are and how they got there?
2. Can I use some kind of PERL script to get rid of them?

Comments

  • JonathanJonathan Posts: 2,914Member
    : I have an xml file that has been edited by someone using a French
    : keyboard.
    :
    Ooh la la...c'est affreux! :-)

    : Somehow the file ended up with the characters i>>? (except the question
    : mark is upside down) at the beginning of the file. The characters are
    : invisible, I cannot see them with any text editor that I have tried.
    : They only show up if I diff the file against a US version.
    :
    : My questions are -
    :
    : 1. Does anyone know what these charaters are and how they got there?
    I'm guessing maybe it's something unicode related.

    : 2. Can I use some kind of PERL script to get rid of them?
    :
    Well, you can always remove any non-ASCII characters. Something like...

    $the_text =~ s/./ord($1) > 127 ? '' : $1/ge;

    May work.

    Jonathan

    ###
    for(74,117,115,116){$::a.=chr};(($_.='qwertyui')&&
    (tr/yuiqwert/her anot/))for($::b);for($::c){$_.=$^X;
    /(p.{2}l)/;$_=$1}$::b=~/(..)$/;print("$::a$::b $::c hack$1.");

Sign In or Register to comment.