IsASCII( const nsAReadableString& aString )
IsASCII( const nsAString& aString )
IsASCII( const nsAReadableString& aString )  {    static const PRUnichar NOT_ASCII = PRUnichar(~0x007F);    // Don't want to use |copy_string| for this task, since we can stop at the first non-ASCII character    nsReadingIterator<PRUnichar> done_reading;    aString.EndReading(done_reading);      // for each chunk of |aString|...    PRUint32 fragmentLength = 0;    nsReadingIterator<PRUnichar> iter;    for ( aString.BeginReading(iter); iter != done_reading; iter.advance( PRInt32(fragmentLength) ) )      {        fragmentLength = PRUint32(iter.size_forward());        const PRUnichar* c = iter.get();        const PRUnichar* fragmentEnd = c + fragmentLength;          // for each character in this chunk...        while ( c < fragmentEnd )          if ( *c++ & NOT_ASCII )            return PR_FALSE;      }    return PR_TRUE;  }