Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Core » conversion from String to wchar_t
conversion from String to wchar_t [message #46125] Sat, 12 March 2016 16:31 Go to next message
forlano is currently offline  forlano
Messages: 1185
Registered: March 2006
Location: Italy
Senior Contributor
Hello,

I'm using an external library that write Excel file (LibXL).
In many functions it uses
wchar_t
as argument. My string are instead simple String although UTF8 encoded. The result is that in the Excel file the accented characters are not displayed correctly.

I tried to convert String to wchar_t but my temptive ended in compiler complains. Is there a way to transform a String in a wchar_t?

Is WString related to wchar_t?

Moreover this library uses to denote a string in this way: L"mystring". My MSCV compiler complain although I included
<wchar.h>. Do we have an UPP equivalent of this weird stuff?

Thanks,
Luigi

[Updated on: Sat, 12 March 2016 16:36]

Report message to a moderator

Re: conversion from String to wchar_t [message #46151 is a reply to message #46125] Fri, 18 March 2016 14:15 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
This should work, as long as sizeof(wchar_t) is 2:

String s;
....
WString h = s.ToWString();
wchar_t *t = (wchar_t *)~h;
Previous Topic: HtmlTable class example request
Next Topic: Please help! New transfer semantic issue!
Goto Forum:
  


Current Time: Thu Apr 18 09:55:50 CEST 2024

Total time taken to generate the page: 0.02356 seconds