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/episodelistview.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/episodelistview.cpp')
-rw-r--r-- | c/episodelistview.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/c/episodelistview.cpp b/c/episodelistview.cpp index cdb3dc7..bc01ce9 100644 --- a/c/episodelistview.cpp +++ b/c/episodelistview.cpp @@ -414,17 +414,16 @@ void EpisodeListView::Update() /* Update episode name and rating. */ void EpisodeListView::UpdateItem(const LVITEM* const pLvi) { - Mark m; - TCHAR* tszName; + std::basic_string<TCHAR> tstrName; int iRating; static TCHAR tszRating[3]; - if (!Pl("episode_data","episode_title",pLvi->lParam,&tszName)) { + if (!Pl("episode_data","episode_title",pLvi->lParam,&tstrName)) { if (!Pl("episode_data","update_episode_data")) goto r; - if (!Pl("episode_data","episode_title",pLvi->lParam,&tszName)) + if (!Pl("episode_data","episode_title",pLvi->lParam,&tstrName)) goto r; } - ListView_SetItemText(hWnd, pLvi->iItem, ELVSITITLE, tszName); + ListView_SetItemText(hWnd, pLvi->iItem, ELVSITITLE, tstrName.data()); r: if (!Pl("episode_data","episode_rating",pLvi->lParam,&iRating)) { ListView_SetItemText(hWnd, pLvi->iItem, ELVSIRATING, (TCHAR*)TEXT("")); |