[Kc] cleaning up unicode?

david nicol whatever at davidnicol.com
Tue Mar 4 21:41:13 CST 2003


if nobody else is going to use the filenames but you and
yours you could make up a munging such as

	my $filename2 = $filename;
	$filename2 =~ s/([zZ\W])/sprintf('z%02x',ord $1)/ge;

then later, demunge with something like

	@filenames = map { s/z(..)/chr(hex $1)/ge } readdir DIR;


q works well too :)



On Tue, 2003-03-04 at 06:38, Scott Kahler wrote:
> I haven't seen any package that do what you are looking for John.
> I've ran into a big of a problem with this recently as I've been
> working with high value ASCII too.  About the only thing I think you'd
> be able to do is a list of one to one conversions.  The problem with
> this that i've run into is that unix, windows and mac all have a
> different character map regaurding character outside our standard
> alphanumerics.

-- 
David Nicol, independent consultant and contractor
perl -Mcoroutine0 -le'$c=new coroutine0 VARS=>[q/@a/],BODY=>q"@a=(74,
65,80,72);while($a=shift at a){YIELD chr$a;}";print while$_=&$c;'




More information about the kc mailing list