腾讯云
开发者社区
文档
建议反馈
控制台
登录/注册
首页
学习
活动
专区
圈层
工具
MCP广场
文章/答案/技术大牛
搜索
搜索
关闭
发布
文章
问答
(9999+)
视频
沙龙
1
回答
UTF8到UTF16
的
转换
使用
std
::UTF16系统::path
、
、
、
从C++11开始,可以使用
std
::
codecvt
_utf8_utf16
将
UTF8
转换为
UTF16 wchar_t (至少在wchar_t为16位宽
的
Windows上)} 不幸
的
是,在
C++17
中,不推荐
std
::
codecvt
_utf8_utf16。但是有
std
::file
浏览 4
提问于2021-06-03
得票数 3
回答已采纳
1
回答
将
std
::
string
转换为
std
::
wstring
时
,
C++17
codecvt
抛出
“
错误
的
转换
”
、
、
、
、
我写了一个名为UString
的
字符串类,我想它可以
将
std
::
string
转换为
std
::
wstring
,也可以
将
std
::
wstring
转换为
std
::
string
。我使用
的
是
c++17
中
的
库,所以我编写了如下代码。(const
std
::
wstring
& wst
浏览 81
提问于2019-11-04
得票数 1
回答已采纳
1
回答
从UTF-8
转换为
UTF-16
的
"
codecvt
_utf8_utf16“和"
codecvt
_utf8”
的
区别
、
、
、
我遇到了两个代码片段和,
std
::
wstring
str =
std
::
wstring
_convert<
std
::<
浏览 1
提问于2019-08-24
得票数 1
回答已采纳
2
回答
如何
将
std
::
string
转换为
WCHAR
、
、
我需要将我拥有的
std
::
string
转换
成WCHAR。有人知道怎么做吗?任何帮助我们都将不胜感激
浏览 0
提问于2016-10-08
得票数 6
1
回答
无法
将
std
::
string
转换为
std
::basic_
string
<char8_t>,为什么?
、
、
、
、
我面临以下问题,我试图使用
std
::
string
库
将
一个
std
::basic_
string
<char8_t>对象
转换为
std
::basic_
string
<char8_t>对象。
string
";
std
::
wstring
_convert <
std
::
codecvt
_utf8_utf16 <char8_t>, c
浏览 8
提问于2022-09-17
得票数 0
回答已采纳
2
回答
如何让
wstring
_convert::to_bytes
抛出
range_error异常?
、
、
、
、
我使用
std
::
wstring
_convert
将
wstring
转换为
多字节字符串,如下所示: try{
浏览 4
提问于2015-08-24
得票数 5
回答已采纳
2
回答
改进用于
将
std
::
string
转换为
std
::
wstring
的
方法
的
性能?
、
、
、
我使用以下方法
将
std
::
string
对象
转换为
std
::
wstring
对象:#include <type_traits>#include<
codecvt
> inline
std
::basic_
string
<CharT> S
浏览 8
提问于2022-09-07
得票数 0
回答已采纳
2
回答
将
C++
std
::
wstring
转换为
utf8和
std
::
codecvt
_xxx
、
、
、
、
C++11有
将
宽字符字符串
std
::
wstring
从/
转换
到utf8表示
的
工具:
std
::
codecvt
、
std
::
codecvt
_utf8、
std
::
codecvt
_utf8_utf16等。哪个窗口应用程序可以
将
常规
的
宽字符Windows字符串
std
::
wstring
转换为
utf8
std<
浏览 4
提问于2016-05-29
得票数 4
1
回答
std
::
string
到
std
::
wstring
的
便携
转换
,反之亦然?
、
、
、
我需要将
std
::
string
转换为
std
::
wstring
。我在visual Studio2010中使用了以下代码(它工作得很好):
std
::
string
narrow = converter.to_bytes(wide_utf16_sour
浏览 7
提问于2016-04-26
得票数 2
1
回答
std
::u32字符串与
std
::
string
和
std
::u16
string
之间
的
转换
、
、
、
、
我需要为不同
的
API/模块在UTF-8,UTF-16和UTF-32之间进行
转换
,因为我知道可以选择使用C++11,所以我正在寻找新
的
字符串类型。看起来我可以对UTF-8、UTF-16和UTF-32使用
string
、u16
string
和u32
string
。我还发现了
codecvt
_utf8和
codecvt
_utf16,它们看起来能够在char或char16_t和char32_t之间进行
转换
,以及看起来像是更高级别的
ws
浏览 4
提问于2015-07-09
得票数 11
回答已采纳
1
回答
在Visual Studio中将字符串
转换为
wstring
失败
、
、
以下代码旨在提供
将
utf-8格式
的
字符串
转换为
utf-16
的
函数。但它失败了。我如何在Visual Studio2017
C++17
中修复它: #define _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS#include <locale>#include <fstrea
浏览 41
提问于2019-01-15
得票数 1
回答已采纳
1
回答
如何使用->
转换
std
::u16
wstring
std
::
wstring
?
、
、
、
我在一个类似的主题上发现了许多问题,但是没有关于<
codecvt
>从宽到宽
转换
的
问题,这在现代代码中应该是正确
的
选择。
std
::
codecvt
_utf16<wchar_t>似乎是执行
转换
的
合乎逻辑
的
选择。 然而,
std
::
wstring
_convert似乎期望
std
::
string
在一端。我
的
意思是,到目前为止,最好<em
浏览 26
提问于2022-01-21
得票数 1
回答已采纳
1
回答
为什么我不能将一个带en破折号
的
字符串
转换为
wstring
?
、
、
、
std
::
string
s = "–";
std
::
wstring
wide
将
初始字符串存储为
wstring
,将其
转换为
字符串,然后再将其
转换
回字符串,将得到正确
的
结果。
std</e
浏览 4
提问于2021-05-04
得票数 0
回答已采纳
2
回答
将
std
::C++
转换为
std
::
wstring
- Windows Linux
的
C++问题
、
、
、
我试图使用以下方法
将
字符串"pokémon"从
std
::"pokémon"
转换为
std
::
wstring
这在Windows
浏览 10
提问于2022-06-24
得票数 3
回答已采纳
2
回答
C++在Linux上使用
wstring
_convert
、
、
我希望能够将从文件中读取
的
文本
转换为
多字节字符。我有下面的C++代码正在为我工作。当我试图在Linux上编译代码
时
,尽管它失败了。#include <locale>
std
::
wstring
_convert<
std
::
codecvt
_utf8_utf16<wchar_t>> utfconv;while (
std
::getline(in
浏览 9
提问于2018-06-14
得票数 0
回答已采纳
1
回答
从
std
::
wstring
转换为
std
::
string
、
、
、
、
我用
std
::
codecvt
_utf8
将
wstring
转换为
中描述
的
字符串,但是当我尝试使用希腊语或汉语字母符号被破坏
时
,我可以在调试局部变量窗口中看到它,例如,日本变成了“-原œ”。
std
::
wstring
_convert<
std
::
codecvt
_utf8<wchar_t>> myconv; //also tried
codecvt
_
浏览 6
提问于2022-01-05
得票数 0
回答已采纳
7
回答
将
const char*
转换为
wstring
我正在为基于锌
的
闪存应用程序开发一个本机扩展,我需要将const char*
转换为
wstring
。这是我
的
密码: else { }但是native.AppendHexDataToFile()需要两个
wstring<
浏览 3
提问于2012-05-24
得票数 37
回答已采纳
1
回答
这些要在字符串和
wstring
之间
转换
的
函数是否应该实现为标头?
、
、
、
、
我正在寻找一种
将
wstring
转换为
string
in C++
的
合适方法,并在上找到了一种不错
的
方法。下面是我如何在我
的
项目中包含
的
一个名为convert.hpp
的
文件中实现它:#include <
codecvt
> inline
std
::
wstring
s2ws(const
std
浏览 1
提问于2014-09-25
得票数 1
回答已采纳
3
回答
如何
将
std
::stringstream
转换为
std
::
wstring
我
的
问题是,如何
将
c++ stringstream
转换为
wstring
或wstringstreamfileSearch<<fileOutput.str();cout<<fileSearch.str()<<endl; 这是我
的
代码。我想把这个fileSearch字符串流
转换
成
wstring
...谁可以帮助我与c
浏览 1
提问于2015-02-25
得票数 3
1
回答
“
std
::
wstring
_convert”以尽可能多地
转换
(从UTF8文件读取
的
块)
、
、
我
的
下一步是
将
这个
std
::
string
转换
成允许我单独处理这些“复杂字符”
的
东西,从而将
std
::
string
转换为
std
::
wstring
。我使用以下函数进行
转换
,#include <
codecvt
>
std
::<
浏览 1
提问于2018-09-14
得票数 1
回答已采纳
点击加载更多
相关
资讯
如何在EasyX中将文件中的汉字绘制到窗体上?并避免出现乱码?
精准姿态控制:旋转数学表示的转换技巧
C+中的 atoi和itoa
这几个C+的坑,一旦踩中了,加班是肯定避免不了了!
Socket网络编程之UDP客户端
热门
标签
更多标签
云服务器
ICP备案
实时音视频
即时通信 IM
对象存储
活动推荐
运营活动
广告
关闭
领券