#!/usr/bin/perl use strict; use warnings; # given: string of bytes # return: hexdump of argument sub hexdump ($) { use bytes; my @bytes = map {[$_, ord]} split //, shift; return '['.join(' ', map {sprintf('%02x', $_->[1])} @bytes).']' .'|'.join('', map { ($_->[1] >= 0x20 && $_->[1] < 0x7F) ? $_->[0] : '.' } @bytes).'|' } use utf8; my $text = q[search/¿Cuales son las partes de una cadena de conexión??scope]; print hexdump($text), "\n"; __END__ #### [73 65 61 72 63 68 2f c2 bf 43 75 61 6c 65 73 20 73 6f 6e 20 6c 61 73 20 70 61 72 74 65 73 20 64 65 20 75 6e 61 20 63 61 64 65 6e 61 20 64 65 20 63 6f 6e 65 78 69 c3 b3 6e 3f 3f 73 63 6f 70 65]|search/..Cuales son las partes de una cadena de conexi..n??scope|