--- old/hotspot/src/share/vm/oops/symbolOop.cpp 2009-08-01 04:13:15.766566109 +0100 +++ new/hotspot/src/share/vm/oops/symbolOop.cpp 2009-08-01 04:13:15.693017371 +0100 @@ -71,8 +71,17 @@ void symbolOopDesc::print_symbol_on(outputStream* st) { st = st ? st : tty; - for (int index = 0; index < utf8_length(); index++) - st->put((char)byte_at(index)); + int length = UTF8::unicode_length((const char*)bytes(), utf8_length()); + const char *ptr = (const char *)bytes(); + jchar value; + for (int index = 0; index < length; index++) { + ptr = UTF8::next(ptr, &value); + if (value >= 32 && value < 127 || value == '\'' || value == '\\') { + st->put(value); + } else { + st->print("\\u%04x", value); + } + } } jchar* symbolOopDesc::as_unicode(int& length) const {