Problem with SoftwareSerial

Hello,

(sorry but I'm french...)
I have an Arduino Uno (R3) and I want to create a software serial port. I use the version 1.0.3 of the Arduino Software with this SoftwareSerial library exemple:

#include <SoftwareSerial.h>

SoftwareSerial mySerial(10, 11); // RX, TX

void setup()  
{
  // Open serial communications and wait for port to open:
  Serial.begin(9600);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for Leonardo only
  }


  Serial.println("Goodnight moon!");

  // set the data rate for the SoftwareSerial port
  mySerial.begin(9600);
  mySerial.println("Hello, world?");
}

void loop() // run over and over
{
  if (mySerial.available())
    Serial.write(mySerial.read());
  if (Serial.available())
    mySerial.write(Serial.read());
}

And I have this in my terminal:

ðf~
~
~Ìþ0Ìó3füþðf~ ~ ~Ìþ0Ìó3füþ¼Õ::
:ûÚtº
Vë¼Õ::
:ûÚtº
Vë¼Õ::
:û?Útº
Vë¼Õ::
:ûÚtº
VëÀ¼Õ::
:ûÚtº
Vëà¼Õ::
:ûÚtº
VëQS£O!O¡MCO!À&KH$Ò#0y=ààÀààÀÀÀÀàÀàÀÀÀàÀÀàÀÀàÀààxÕ::
:ûité
Vë«ÓÒR¤Útºë«ÓÒR¤Útºë«ÓÒR¤ÚtºëO!MMÞ5''!¿Q!åëþ«ÓÒR¤Útºë¤«ÓÒR
ÚätéIÞ«ÃÒR
ÚätéIÞ«ÓÒR
ÚåtéIÞ

I already tested with another baudrate and with different arduino but I still have this proble.
Also I used the AltSoftSerial library and it's the same display in the terminal

Do you have any idea ?

For more information on my project, I want to use the hardware serial with Xbee and the software serial with my computer to display information.

Thanks.

What is the baud rate setting of the Serial Monitor? It needs to match that of the Arduino.

What is connected to pins 10 and 11?

For more information on my project, I want to use the hardware serial with Xbee and the software serial with my computer to display information.

How are you connecting the software serial port to the PC? You'd be a lot better off using SoftwareSerial to talk to the XBee and the hardware serial port to talk to the PC.

I use an USB-serial adapter (Link) and I connect the TX pin of the adapter to the pin 10 (RX) of the arduino and RX pin to the pin 11 (TX).
In the Serial Monitor, the baud rate is set to 9600 baud .
For the Xbee, I use a Xbee Shield and I can't choose the pin that it uses...

For the Xbee, I use a Xbee Shield and I can't choose the pin that it uses...

I can with the XBee shield I use (from Sparkfun).

It looks like you need a MAX232 chip between the Arduino and that device. That would explain the garbage in the Serial Monitor, because that device is not a TTL device.