Beispiel #1
0
VALUE wrap< sf::String >(const sf::String &cstr )
{

	std::string str(cstr.begin(),cstr.end());
#ifdef HAVE_RUBY_ENCODING_H
	return rb_enc_str_new(str.c_str(),strlen(str.c_str()),rb_utf8_encoding());
#else
	return rb_str_new2(str.c_str());
#endif
}
Beispiel #2
0
std::string GUI::Widget::utf8FromString(const sf::String& s) {
	std::string str8;
	sf::Utf<32>::toUtf8(s.begin(), s.end(), std::back_inserter(str8));
	return str8;
}