From c6cd2f1f164baac1414f2cf658566de146b10552 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Sat, 23 Jul 2022 18:59:37 +0200 Subject: 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. --- c/episodelistview.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'c/episodelistview.cpp') 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 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("")); -- cgit v1.2.3