GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
XML2ASC(1) HTML-XML-utils XML2ASC(1)

xml2asc - convert UTF-8 to &#nnn; entities

xml2asc

Reads an UTF-8 encoded text from standard input and writes to standard output, converting all non-ASCII characters to &#nnn; entities, so that the result is ASCII-encoded.

One example use is to convert ISO-8859-1 to ASCII with &#nnn; entities, by first running asc2xml to convert ISO-8859-1 to UTF-8 and then pipe the result into xml2asc to convert to ASCII with &#nnn; entities for all accented characters.

To test if a file is correct UTF-8, ignore the output and test the exit code, e.g. in Bash:


xml2asc <myfile >/dev/null && echo "OK" || echo "Fail"

xml2asc returns with a non-zero exit code if the input was not UTF-8.

asc2xml(1), UTF-8 (RFC 2279)

Doesn't distinguish mark-up from content, so if the input uses non-ASCII characters in XML element names, they will be output with numerical entities in them, which is not legal in XML.
10 Jul 2011 7.x

Search for    or go to Top of page |  Section 1 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.