You are not logged in.

Dear visitor, welcome to QtForum.org. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

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.