HTML::Entities
takes a string and encodes it to use HTML entities, or takes a (HTML-)text (with HTML entities) and decodes it into a »normal« string. #!/usr/bin/perl use warnings; use strict; use feature 'say'; use utf8; use HTML::Entities; say encode_entities ('> René'); # prints «> René»