From: Conrad Schneiker Date: 2000-07-12T00:39:16-05:00 Subject: [ruby-talk:03941] Possibly relevant Windows-related Perl stuff (sprintf tests, Unicode input). Hi, These are a couple of items I came across when looking at what the competition is up to, which may be of some relevance to present/future Ruby work on Windows platforms. ## sprintf tests ## Sarathy pointed out a problem with Dominic Dunlop's excellent sprintf tests: Not all systems produce output with exactly two digits of exponent information, so many tests fail on Windows systems, for example. (The C standard only requires that there be at least two digits.) Dominic said he would think about what to do about this, but has not said anything about it since then. ## Unicode Input Solution ## Simon reported a clever suggestion from the Perl-Unicode mailing list. Some systems, such as Windows, store system data like directory entries in unicode. You'd like to flag such inputs as UTF8 when they are read in. The suggestion was to piggyback this atop the tainting mechanism. At present, there's a macro which, if taint mode is on, turns on the taint flag on the input scalar for every input Perl reads from any source. Simon posted a patch which extends the macro so that if use utf8 is in scope, and the string is a valid UTF8 string, Perl will also set the UTF8 flag on the scalar. Since presumably everything is already checked for taintedness when it's read in, this automatically puts the check for UTF8-ness everywhere also. -- Conrad Schneiker (This note is unofficial and subject to improvement without notice.)