diff options
author | John Ankarström <john@ankarstrom.se> | 2022-07-23 18:59:37 +0200 |
---|---|---|
committer | John Ankarström <john@ankarstrom.se> | 2022-07-23 18:59:37 +0200 |
commit | c6cd2f1f164baac1414f2cf658566de146b10552 (patch) | |
tree | cec573bbddacd175f37d8d45e48e8cea80727420 /c/datalistview.cpp | |
parent | 2958c57db73b5af03af36598c9dffc9123a0a003 (diff) | |
download | EpisodeBrowser-c6cd2f1f164baac1414f2cf658566de146b10552.tar.gz |
Fix display of Unicode text.
Turns out that SWI-Prolog's wide string functions, which I started
using in 03fe361, do not convert between narrow Prolog atoms and wide
C strings, as I mistakenly thought. Instead, they work with wide
Prolog atoms. In hindsight, it is not surprising.
Diffstat (limited to 'c/datalistview.cpp')
-rw-r--r-- | c/datalistview.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/c/datalistview.cpp b/c/datalistview.cpp index b728fa8..1ceeb3b 100644 --- a/c/datalistview.cpp +++ b/c/datalistview.cpp @@ -57,21 +57,21 @@ void DataListView::ShowEpisode(const int iEpisode) PL_predicate("episode_datum", 3, "episode_data"), t); for (int i = 0; PL_next_solution(q); i++) { - TCHAR* tszKey; - TCHAR* tszValue; + std::basic_string<TCHAR> tstrKey; + std::basic_string<TCHAR> tstrValue; - if (!(PlGet(t+1, &tszKey) && PlGet(t+2, &tszValue))) + if (!(PlGet(t+1, &tstrKey) && PlGet(t+2, &tstrValue))) continue; lviKey.mask = LVIF_TEXT; lviKey.iItem = i; lviKey.iSubItem = 0; - lviKey.pszText = tszKey; + lviKey.pszText = tstrKey.data(); ListView_InsertItem(hWnd, &lviKey); lviValue.iItem = i; lviValue.iSubItem = 1; - lviValue.pszText = tszValue; + lviValue.pszText = tstrValue.data(); ListView_SetItem(hWnd, &lviValue); } |