nsReadingIterator<char> fromBegin, fromEnd; LossyConvertEncoding<char, PRUnichar> converter(result); copy_string(aSource.BeginReading(fromBegin), aSource.EndReading(fromEnd), converter).write_terminator();
nsReadingIterator<PRUnichar> fromBegin, fromEnd; PRUnichar* toBegin = result; *copy_string(aSource.BeginReading(fromBegin), aSource.EndReading(fromEnd), toBegin) = PRUnichar(0);
ToNewUnicode( const nsAReadableCString& aSource )  {    PRUnichar* result = AllocateStringCopy(aSource, (PRUnichar*)0);    nsReadingIterator<char> fromBegin, fromEnd;    LossyConvertEncoding<char, PRUnichar> converter(result);    copy_string(aSource.BeginReading(fromBegin), aSource.EndReading(fromEnd), converter).write_terminator();    return result;  }