NAME

Encode::Wide - Convert wide characters (Unicode) into HTML or XML-safe ASCII entities

VERSION

0.03

SYNOPSIS

use Encode::Wide qw(wide_to_html wide_to_xml);

my $html = wide_to_html(string => "Café déjà vu – naïve façade");
# returns: 'Café déjà vu – naïve façade'

my $xml = wide_to_xml(string => "Café déjà vu – naïve façade");
# returns: 'Café déjà vu – naïve façade'

DESCRIPTION

Encode::Wide provides functions for converting wide (Unicode) characters into ASCII-safe formats suitable for embedding in HTML or XML documents. It is especially useful when dealing with text containing accented or typographic characters that need to be safely represented in markup.

The module offers two exportable functions:

PARAMETERS

Both functions accept a named parameter:

ENCODING

Input strings are expected to be valid UTF-8. If a byte string is passed, the module will attempt to decode it appropriately. Output is guaranteed to be pure ASCII.

EXPORT

None by default.

Optionally exportable:

wide_to_html
wide_to_xml

SEE ALSO

HTML::Entities, Encode, XML::Entities, Unicode::Escape.

https://www.compart.com/en/unicode/.

AUTHOR

Nigel Horne njh@nigelhorne.com

LICENCE AND COPYRIGHT

Copyright 2025 Nigel Horne.

Usage is subject to licence terms.

The licence terms of this software are as follows: