aStream << (char) aString[i];
putchar((char) aString[i]);
static void DebugDump(nsString& aString, ostream& aStream) {#ifdef WIN32  char s[512];  int len = WideCharToMultiByte(GetACP(), 0,                                (LPCWSTR ) aString.get(),  aString.Length(),                                s, 512, NULL,  NULL);  s[len] = '\0';  aStream.flush();  printf("%s\n", s);#elif defined(XP_MAC) || defined(XP_MACOSX)	// Use TEC (Text Encoding Conversion Manager)  TextEncoding outEncoding;  TECObjectRef anEncodingConverter;  ByteCount oInputRead, oOutputLen;  char oOutputStr[512];  OSStatus err = 0;  err = UpgradeScriptInfoToTextEncoding	(smSystemScript/*smCurrentScript*/, kTextLanguageDontCare, kTextRegionDontCare, NULL, &outEncoding);  err = TECCreateConverter(&anEncodingConverter, kTextEncodingUnicodeV2_0, outEncoding);  err = TECConvertText(anEncodingConverter,                       (ConstTextPtr) aString.get(), aString.Length() * sizeof(PRUnichar), &oInputRead,                       (TextPtr) oOutputStr, 512, &oOutputLen);  err = TECDisposeConverter(anEncodingConverter);    oOutputStr[oOutputLen] = '\0';  aStream.flush();  printf("%s\n", oOutputStr);#else  for (int i = 0; i < aString.Length(); i++) {    aStream << (char) aString[i];  }  aStream << "\n";#endif}