Softpedia
 


SCRIPTS CATEGORIES:



NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Koken 0.8.2
  • ContentBox 1.5.2
  • jQPlayer 0.5.2
  • SPOILER ALERT! 0.0.2
  • jQuery Mask Plugin 0.9.0
  • Easing Slider 2.1.2
  • Btapp.js 0.2.0
  • WiiFlash 0.4.5
  • Breeze.js 1.3.3
  • TinyMCE Templates 3.0.2
  • Home > Scripts > Modules

    Encode-ZapCP1252 0.01

    Download button


    Downloads: 391  Tell us about an update
    User Rating:
    Rated by:
    Good (3.2/5)
    16 user(s)
    Developer:

    Website:

    License / Price:
    Platforms:

    Databases:

    Language:

    Last Updated:

    Category:
    David Wheeler | More scripts
    cpan.uwinnipeg.ca
     

    Windows / Linux / Mac OS / BSD / Solaris
    N/A
    Perl
    June 11th, 2007, 08:10 GMT
    C: \ Modules

     Read user reviews (0)  Refer to a friend  Subscribe

    Encode-ZapCP1252 description

    Encode-ZapCP1252 module performs an *in place* conversion of the CP1252 gremlins into appropriate ASCII approximations.

    This module performs an *in place* conversion of the CP1252 gremlins into appropriate ASCII approximations.< into app you ever been processing a Web form submit, assuming that the incoming text was encoded in ISO-8859-1 (Latin-1), only to end up with a bunch of junk because someone pasted in content from Microsoft Word? Well, this is because Microsoft uses a superset of the Latin-1 encoding called "Windows Western" or "CP1252". So mostly things will come out right, but a few things--like curly quotes, m-dashes, elipses, and the like--will not. The differences are well-known; you see a nice chart at documenting the differences on Wikipedia: .

    Of course, that won't really help you. What will help you is to quit using Latin-1 and switch to UTF-8. Then you can just convert from CP1252 to UTF-8 without losing a thing, just like this: use Encode; $text = decode('cp1252', $text, 1);But I know that there are those of you out there stuck with Latin-1 and who don't want any junk charactrs from Word users, and that's where this module comes in. It will zap those CP1252 gremlins for you, turning them into their appropriate UTF-8 approximations.

    Usage

    This module exports a single subroutine: "zap_cp1252()". You use it like this zap_cp1252($text); This subroutine performs an *in place* conversion of the CP1252 gremlins into appropriate ASCII approximations.

    Note that because the conversion happens in place, the data to be converted *cannot* be a string constant; it must be a scalar variable.



    TAGS:

    encode module | encode tool | encoding perl | perl | encoding | module

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM