Results 1 to 2 of 2

Thread: SOLVED QString::fromWCharArray gives strange charracters

  1. #1
    Join Date
    Apr 2010
    Posts
    48
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Windows

    Default SOLVED QString::fromWCharArray gives strange charracters

    Hi..

    I have a string named aDrive = "H:/"

    i want to convert this string into WCHAR so used like below

    WCHAR Drive[4];

    aDrive.toWCharArray ( Drive ) ;

    when i printed it qDebug ()<<QString::fromWCharArray ( Drive );

    it displays like "H:/???"

    why i get the starnge charracters at the end..

    Thank you for your time
    Last edited by newb; 28th June 2010 at 12:06.

  2. #2
    Join Date
    Jun 2010
    Location
    India
    Posts
    50
    Thanks
    1
    Thanked 15 Times in 14 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QString::fromWCharArray gives strange charracters

    WCHAR Drive[4]={0}; should solve your problem

Similar Threads

  1. Replies: 4
    Last Post: 1st February 2010, 14:21
  2. QString operator+= strange behaviour
    By babu198649 in forum Newbie
    Replies: 13
    Last Post: 17th January 2010, 05:54
  3. Replies: 4
    Last Post: 31st January 2008, 20:44
  4. strange problem about QString::number(double)
    By yuzr in forum Qt for Embedded and Mobile
    Replies: 4
    Last Post: 24th December 2007, 13:05
  5. how to copy part of QString to anothe QString
    By nass in forum Qt Programming
    Replies: 1
    Last Post: 26th March 2007, 19:05

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.