Encode-zapcp1252 v0.01

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.

Related Scripts

  • Encode-javascript-ucs 0.01
    Encode::JavaScript::UCS is an Encoding module to represent JavaScript unicode characters like ``u5bae''.SYNOPSIS use Encode::JavaScript::UCS; my $name...
  • Encode-punycode 1.001
    Punycode is an efficient encoding (ACE) of Unicode for use with IDNA.SYNOPSIS use Encode::Punycode; use Encode; $utf8 = decode('Punycode', $punycode);...
  • Encode-ibm 0.05
    Encode::IBM module deals with IBM-specific encpings.?&pings.Encode::IBM uses the standard perl module install process: cpansign -v # optional; s...
  • Encode-handetect 0.01
    Encode::HanDetect is a thin wrapper around Lingua::ZH::HanDetect, providing the ability to treat any incoming Chinese data equally, regardless of its ...
  • Url And Xml Encode
    url and xml encode to fool naive web spiders...
  • Secret Encoder 1.0
    This script allows you to encode your message into numbers. Just type your message and click ENCODE or if you have a message encoded already, all you ...
  • Url Decode Encode
    Use this script to encode/decode URL parameters. It is fully compatible with UTF-8 encoding. Very useful when you want to transfer data using Ajax tec...
  • Encode-arabic 1.4
    This module is a wrapper for various implementations of the encoding systems used for the Arabic language and covering even some non-Arabic extensions...
  • Encode Decode Ascii Binary
    Very simple program to convert regular ASCII text to a block of binarry numbers and vise versa. Just run the following commands to view an example:enc...
  • Encode-doubleencodedutf8 0.05
    Encode::DoubleEncodedUTF8 adds new encoding utf-8-de and fixes double encoded utf-8 bytes found in the original bytes to the correct Unicode entity.Th...
  • Base64 Urlencode And More Data Transformation
    Data transformation tool for Base64 encode or decode; URL encode or decode; htmlentities; addslashes - plus an 'all' option, which is good for compari...
  • Encode-teckit 0.04
    This module interfaces with the TECkit processor to provide a Perl interface for data conversion. TECkit is a binary encoding converter designed to ha...
  • Convolutional Encoder Simulation
    Use this to convolutionally encode bit sequences of any length. It takes the bit sequence and constraint length as input. It returns the encoded seque...
  • Encode::jp::mobile 0.30
    Encode::JP::Mobile is an encoding module to support Shift_JIS variants used in Japaese mobile phone Internet browsers. Here are some key features of "...
  • Openpgp.php 0.0.1
    Defined by the RFC 4880 standard the class can encode and decode ASCII-protected OpenPGP messages. OpenPGP.php is currently used with the OpenPGP Drup...
  • Php And Ajax Tool To Transform Text
    Allows instant transformation of data into following formats: base64 encode decode, urlencode decode, md5 and sha1 hashing, rot13, addslashes and html...
  • Encode-hanconvert 0.33
    This module is an attempt to solve most common problems occured in Traditional vs. Simplified Chinese conversion, in an efficient, flexible way, witho...
  • Wutils 1.4.2
    Not big or useful enough to be packed as a stand-alone plugin, these simple classes will help developers nevertheless.The package contains tools to he...
  • Email Address Encoder 1.0.4
    The plugin encodes an email address into a decimal and hexadecimal format.There's no interface, works out via special WP functions detailed in th...
  • Tencoder 1.0
    tEncoder is an encryption software designed to encrypt PHP files for use as software. tEncoder uses a complex encryption system to encode PHP scripts ...
DMCA Notice-Privacy Policy
2004 - 2013 DownScripts. All rights reserved.