[Rd] wchar and wstring.

From: James Bullard <bullard_at_berkeley.edu>
Date: Fri 26 Aug 2005 - 22:56:14 GMT


Hello all, I am writing an R interface to some C++ files which make use of std::wstring classes for internationalization. Previously (when I wanted to make R strings from C++ std::strings), I would do something like this to construct a string in R from the results of the parse.

SET_VECTOR_ELT(vals, i++, mkString(header.GetHeader().c_str()));

However, now the call header.GetHeader().c_str() returns a pointer to an array of wchar_t's. I was going to use
wcstombs() to convert the wchar_t* to char*, but I wanted to see if there was a similar function in R for the mkString function which I had
initially used which deals with wchar_ts as opposed to chars. Also, since I have no experience with the wctombs() function I wanted to ask if anyone knew if this will handle the internationilzation issues from within R.

As always thank you for the help. jim



R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Sat Aug 27 09:00:24 2005

This archive was generated by hypermail 2.1.8 : Mon 20 Feb 2006 - 03:21:19 GMT