You are not logged in.

1

Tuesday, August 16th 2005, 8:42am

conversion of char* to UniChar* ??

Hi all

I am developing an application using QT programming. I have to use system API for this i have to pass UniChar string to API but i have Char * string. How i can convert this char * to UniChar * . How i can convert the QString type string to UniChar * string??.


Thanks and Regards

dimitri

Professional

  • "dimitri" is male

Posts: 1,311

Occupation: Engineer

  • Send private message

2

Tuesday, August 16th 2005, 10:20am

RE: conversion of char* to UniChar* ??

Try QString::ucs2() or QString::utf8() depending on which Unicode encoding you expect to find in the UniChar string.

3

Tuesday, August 16th 2005, 2:46pm

Hi

I am working on QT for Mac. I have to create a file using FSCreateFileUnicode() for this API i have to pass UniChar * name . But i have name which is of QString type. How should i have to convert this QString to UniChar*.


Thanks and Regards

chickenblood

Professional

Posts: 657

Location: Mountain View, CA

Occupation: Data Monkey

  • Send private message

4

Tuesday, August 16th 2005, 5:36pm

I could be wrong, but I believe the MAC native encoding is utf8. Try using the QString::utf8() and QString::fromUtf8() functions.
I have enough sense to know that "common sense" is an oxymoron.