Overview
Features
Download
Documentation
Community
Add-Ons & Services

Unicode paths and Launch

Please post support and help requests here.

Unicode paths and Launch

Postby rsilvergun » 19 Nov 2013, 06:18

Hi all,

Can I use Poco::Process::launch() with unicode file paths like so:

Poco::Pipe outPipe;
ProcessHandle myPH = Poco::Process::launch("C:\temp\\私\\hello.exe", args, 0, &outPipe, 0);

Poco::PipeInputStream istr(outPipe);
std::ofstream ostr("c:\\temp\\poco_processes.txt");
Poco::StreamCopier::copyStream(istr, ostr);

This works if I take out the '私' (japanese character 'Watashi'), but blows up in my copy of Visual C++ with it. I'm trying to support users of my app that have unicode in their paths / usernames, and I was hoping to use poco to make it nice and cross platform :) Thanks again!
rsilvergun
 
Posts: 3
Joined: 12 Nov 2012, 02:16

Re: Unicode paths and Launch

Postby guenter » 19 Nov 2013, 07:26

You can use Process::launch() with Unicode (UTF-8) paths. However, you cannot specify a UTF-8 path in a string literal with Visual C++ 2008 or newer even if your source file is UTF-8 encoded (http://stackoverflow.com/questions/6887 ... ual-c-2008). You'll have to put the path into a configuration file and read it from there, or properly UTF-8 encode your string using escape sequences.
guenter
 
Posts: 1132
Joined: 11 Jul 2006, 16:27
Location: Austria

Re: Unicode paths and Launch

Postby rsilvergun » 20 Nov 2013, 02:11

Thanks :). I wanted to be sure it would work before I played around with the unicode :).
rsilvergun
 
Posts: 3
Joined: 12 Nov 2012, 02:16


Return to Support

Who is online

Users browsing this forum: bgolenko and 5 guests