I think it's impossible in principle to do it generally
(a given string is a bunch of numbers that can be valid
in more than one charset), but I'd like to see a module that does it well based on whatever heuristics. I see a couple CPAN modules, but I'm not sure how well they work.