当前位置: 首页 > article >正文

osgearth控件显示中文(八)

当前自己知道的方法大概有以下两种:

(一)直接转成utf8

其实在前面的文章中已经有了。

osgEarth::Annotation::PlaceNode *pn = new osgEarth::Annotation::PlaceNode(GeoPoint(geoSRS, 110, 34), String2UTF8("中国"), style);
std::wstring String2Wstring(const std::string& str)
{
	if (str.empty())
	{
		return L"";
	}
	unsigned len = str.size() + 1;
	setlocale(LC_CTYPE, "");
	wchar_t* p = new wchar_t[len];
	mbstowcs(p, str.c_str(), len);
	std::wstring w_str(p);
	delete[] p;
	return w_str;
}

std::string String2UTF8(const std::string& str)
{
	std::wstring_convert<std::codecvt_utf8<wchar_t>> converter;
	std::wstring temp = String2Wstring(str);
	std::string stri

http://www.kler.cn/a/549227.html

相关文章:

  • Audio-Visual Speech Enhancement(视听语音增强)领域近三年研究进展与国内团队及手机厂商动态分析
  • 【函数题】6-10 二分查找
  • 【LeetCode】438.找到字符串中所有的字母异位词
  • 请解释设备像素、CSS 像素、设备独立像素、DPR、PPI 之间的区别?
  • 详解如何使用Pytest内置Fixture tmp_path 管理临时文件
  • Redis之持久化
  • VUE3环境搭建
  • 【iOS】SwiftUI状态管理
  • Kotlin 2.1.0 入门教程(十八)函数式接口
  • AI与SEO协同:智能关键词挖掘与精准部署策略
  • 2025年前端工程师职业发展的系统性应聘规划
  • 深度学习(1)-简单神经网络示例
  • 【力扣】98.验证搜索二叉树
  • 2025 N1CTF crypto 复现
  • linux-5.10.110内核源码分析 - bcm2711 pcie BAR地址分配
  • Vue 3 30天精进之旅:Day 26 - SSR与Nuxt.js
  • Linux、Docker与Redis核心知识点与常用命令速查手册
  • haproxy实现MySQL服务器负载均衡
  • 用队列实现栈
  • pycharm上传github问题:rejected