teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

1

コードの追加

2018/05/02 01:22

投稿

ths
ths

スコア21

title CHANGED
File without changes
body CHANGED
@@ -130,4 +130,21 @@
130
130
  【input.txt】
131
131
  ```ここに言語を入力
132
132
  06,248,108
133
- ```
133
+ ```
134
+
135
+ 【補足】
136
+ 問題の部分を変更しました
137
+ ```ここに言語を入力
138
+ virtual void PXCAPI OnRecognition(const PXCSpeechRecognition::RecognitionData *data) {
139
+ wprintf_s(L"Output %s\n", data->scores[0].sentence);
140
+ //std::ofstream ofs(path);
141
+ wstring_convert<codecvt_utf8<wchar_t>, wchar_t> cv;
142
+ wstring wstr = wstring(data->scores[0].sentence);
143
+   string str = cv.to_bytes(wstr);
144
+ cout << str << endl;
145
+ //ofs << wstr//2018.05.02 問題の箇所
146
+ //ofs.close();
147
+ }
148
+ ```
149
+ コンソールで実行すると、strが文字化けしています。
150
+ 日本語のため、まだ追加処理が必要なのでしょうか?