diff --git a/dic/compdic.cpp b/dic/compdic.cpp index f2bb73a..462d562 100644 --- a/dic/compdic.cpp +++ b/dic/compdic.cpp @@ -90,7 +90,7 @@ void CompDic::addLetter(wchar_t chr, int points, int frequency, if (!iswalpha(chr) && chr != L'?') { ostringstream ss; - ss << fmt(_("'%1%' is not a valid letter.")) % convertToMb(chr) << endl; + ss << fmt(_("'%1%' is not a valid letter.")) % lfw(chr) << endl; ss << fmt(_("For technical reasons, Eliot currently only supports " "alphabetical characters as internal character " "representation, even if the tile has a display string " @@ -324,7 +324,7 @@ Header CompDic::generateDawg(const string &iWordListFile, const string &iDawgFile, const string &iDicName) { - m_headerInfo.dicName = convertToWc(iDicName); + m_headerInfo.dicName = wfl(iDicName); // We are not (yet) able to build the GADDAG format m_headerInfo.dawg = true; diff --git a/dic/dic_search.cpp b/dic/dic_search.cpp index fdf27e0..71028cb 100644 --- a/dic/dic_search.cpp +++ b/dic/dic_search.cpp @@ -427,7 +427,7 @@ bool Dictionary::searchRegExp(const wstring &iRegexp, if (!parsingOk) { delete root; - throw InvalidRegexpException(convertToMb(iRegexp)); + throw InvalidRegexpException(lfw(iRegexp)); } int ptl[REGEXP_MAX+1]; diff --git a/dic/header.cpp b/dic/header.cpp index 9c7fdeb..afb4f05 100644 --- a/dic/header.cpp +++ b/dic/header.cpp @@ -220,7 +220,7 @@ Header::Header(const DictHeaderInfo &iInfo) } m_compressDate = time(NULL); - m_userHost = convertToWc(ELIOT_COMPILE_BY + string("@") + ELIOT_COMPILE_HOST); + m_userHost = wfl(ELIOT_COMPILE_BY + string("@") + ELIOT_COMPILE_HOST); m_root = iInfo.root; m_nbWords = iInfo.nwords; m_nodesUsed = iInfo.nodesused; @@ -307,7 +307,7 @@ unsigned int Header::getCodeFromChar(wchar_t iChar) const char s[5]; sprintf(s, "%d", iChar); format fmt(_("Header::getCodeFromChar: No code for letter '%1%' (val=%2%)")); - fmt % convertToMb(iChar) % s; + fmt % lfw(iChar) % s; throw DicException(fmt.str()); } return pair->second; @@ -624,13 +624,13 @@ wstring Header::writeDisplayAndInput() const void Header::print() const { #define fmt(x) boost::format(x) - cout << fmt(_("Dictionary name: %1%")) % convertToMb(m_dicName) << endl; + cout << fmt(_("Dictionary name: %1%")) % lfw(m_dicName) << endl; char buf[150]; strftime(buf, sizeof(buf), "%c", gmtime(&m_compressDate)); cout << fmt(_("Compressed on: %1%")) % buf << endl; - cout << fmt(_("Compressed using a binary compiled by: %1%")) % convertToMb(m_userHost) << endl; + cout << fmt(_("Compressed using a binary compiled by: %1%")) % lfw(m_userHost) << endl; cout << fmt(_("Dictionary type: %1%")) % (m_type == kDAWG ? "DAWG" : "GADDAG") << endl; - cout << fmt(_("Letters: %1%")) % convertToMb(m_letters) << endl; + cout << fmt(_("Letters: %1%")) % lfw(m_letters) << endl; cout << fmt(_("Number of letters: %1%")) % m_letters.size() << endl; cout << fmt(_("Number of words: %1%")) % m_nbWords << endl; long unsigned int size = sizeof(Dict_header_old) + @@ -668,7 +668,7 @@ void Header::print() const first = false; else s += " "; - s += convertToMb(inputs[j]); + s += lfw(inputs[j]); } fmter % s; } diff --git a/dic/listdic.cpp b/dic/listdic.cpp index 3d3b65f..69465aa 100644 --- a/dic/listdic.cpp +++ b/dic/listdic.cpp @@ -40,7 +40,7 @@ static void printDicRec(ostream &out, const Dictionary &iDic, const wchar_t * co if (edge.term) /* edge points at a complete word */ { *s = '\0'; - out << convertToMb(buf) << endl; + out << lfw(buf) << endl; } if (edge.ptr) { /* Compute index: is it non-zero ? */ diff --git a/dic/regexpmain.cpp b/dic/regexpmain.cpp index cabbd3f..7808446 100644 --- a/dic/regexpmain.cpp +++ b/dic/regexpmain.cpp @@ -94,12 +94,12 @@ int main(int argc, char* argv[]) vector wordList; try { - dic.searchRegExp(convertToWc(line), wordList, 1, 15); + dic.searchRegExp(wfl(line), wordList, 1, 15); cout << _("result:") << endl; vector::const_iterator it; for (it = wordList.begin(); it != wordList.end(); it++) { - cout << convertToMb(*it) << endl; + cout << lfw(*it) << endl; } } catch (InvalidRegexpException &e) diff --git a/dic/tile.cpp b/dic/tile.cpp index adb32cc..6e5c821 100644 --- a/dic/tile.cpp +++ b/dic/tile.cpp @@ -58,7 +58,7 @@ Tile::Tile(wchar_t c) else { ostringstream ss; - ss << "Tile::Tile: Unknown character: " << convertToMb(c); + ss << "Tile::Tile: Unknown character: " << lfw(c); throw DicException(ss.str()); } } diff --git a/game/bag.cpp b/game/bag.cpp index e37f72a..febe86c 100644 --- a/game/bag.cpp +++ b/game/bag.cpp @@ -82,7 +82,7 @@ unsigned int Bag::getNbConsonants() const void Bag::takeTile(const Tile &iTile) { ASSERT(in(iTile), - "The bag does not contain the letter " + convertToMb(iTile.getDisplayStr())); + "The bag does not contain the letter " + lfw(iTile.getDisplayStr())); m_tilesMap[iTile]--; m_ntiles--; @@ -92,7 +92,7 @@ void Bag::takeTile(const Tile &iTile) void Bag::replaceTile(const Tile &iTile) { ASSERT(in(iTile) < iTile.maxNumber(), - "Cannot replace tile: " + convertToMb(iTile.getDisplayStr())); + "Cannot replace tile: " + lfw(iTile.getDisplayStr())); m_tilesMap[iTile]++; m_ntiles++; diff --git a/game/coord.cpp b/game/coord.cpp index 2fbdaae..3747b82 100644 --- a/game/coord.cpp +++ b/game/coord.cpp @@ -76,7 +76,7 @@ void Coord::setFromString(const wstring &iWStr) { // TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO // Temporary implementation: convert the wchar_t* string into a char* one - string iStr = convertToMb(iWStr); + string iStr = lfw(iWStr); char l[4]; int col; diff --git a/game/duplicate.cpp b/game/duplicate.cpp index 4754512..a102b8c 100644 --- a/game/duplicate.cpp +++ b/game/duplicate.cpp @@ -187,7 +187,7 @@ void Duplicate::tryEndTurn() void Duplicate::recordPlayerMove(const Move &iMove, Player &ioPlayer, bool isForHuman) { - LOG_INFO("Player " << ioPlayer.getId() << " plays: " << convertToMb(iMove.toString())); + LOG_INFO("Player " << ioPlayer.getId() << " plays: " << lfw(iMove.toString())); Command *pCmd = new PlayerMoveCmd(ioPlayer, iMove); pCmd->setAutoExecution(!isForHuman); accessNavigation().addAndExecute(pCmd); diff --git a/game/freegame.cpp b/game/freegame.cpp index 5165d7d..938e34e 100644 --- a/game/freegame.cpp +++ b/game/freegame.cpp @@ -116,7 +116,7 @@ void FreeGame::playAI(unsigned int p) void FreeGame::recordPlayerMove(const Move &iMove, Player &ioPlayer, bool isForHuman) { - LOG_INFO("Player " << ioPlayer.getId() << " plays: " << convertToMb(iMove.toString())); + LOG_INFO("Player " << ioPlayer.getId() << " plays: " << lfw(iMove.toString())); Command *pCmd = new PlayerMoveCmd(ioPlayer, iMove); pCmd->setAutoExecution(!isForHuman); accessNavigation().addAndExecute(pCmd); diff --git a/game/game.cpp b/game/game.cpp index c5b4dc1..263d981 100644 --- a/game/game.cpp +++ b/game/game.cpp @@ -344,8 +344,8 @@ PlayedRack Game::helperSetRackRandom(const PlayedRack &iPld, // Get the best word const Round & bestRound = res.get(0); LOG_DEBUG("helperSetRackRandom(): initial rack: " - << convertToMb(pld.toString()) << " (best word: " - << convertToMb(bestRound.getWord()) << ")"); + << lfw(pld.toString()) << " (best word: " + << lfw(bestRound.getWord()) << ")"); // Identify the joker for (unsigned int i = 0; i < bestRound.getWordLen(); ++i) @@ -355,7 +355,7 @@ PlayedRack Game::helperSetRackRandom(const PlayedRack &iPld, const Tile &jokerTile = bestRound.getTile(i); Tile replacingTile(towupper(jokerTile.toChar())); LOG_DEBUG("helperSetRackRandom(): replacing Joker with " - << convertToMb(replacingTile.toChar())); + << lfw(replacingTile.toChar())); // If the bag does not contain this letter anymore, // simply keep the joker in the rack. @@ -459,7 +459,7 @@ void Game::addPlayer(Player *iPlayer) iPlayer->setId(getNPlayers()); m_players.push_back(iPlayer); - LOG_INFO("Adding player '" << convertToMb(iPlayer->getName()) + LOG_INFO("Adding player '" << lfw(iPlayer->getName()) << "' (" << (iPlayer->isHuman() ? "human" : "AI") << ")" << " with ID " << iPlayer->getId()); } diff --git a/game/game_factory.cpp b/game/game_factory.cpp index 2c9fcb2..fa3bb8c 100644 --- a/game/game_factory.cpp +++ b/game/game_factory.cpp @@ -152,10 +152,10 @@ Game *GameFactory::createFromCmdLine(int argc, char **argv) // TODO: use Boost.Format char s[200]; snprintf(s, 200, _("Player %u"), m_players.size() + 1); - name = convertToWc(s); + name = wfl(s); } else - name = convertToWc(optarg); + name = wfl(optarg); m_players.push_back(make_pair(res == 'u', name)); } break; diff --git a/game/game_io.cpp b/game/game_io.cpp index 58ae0ce..be84566 100644 --- a/game/game_io.cpp +++ b/game/game_io.cpp @@ -128,7 +128,7 @@ Game* Game::gameLoadFormat_14(FILE *fin, const Dictionary& iDic) /* rack */ strncpy(rack, token, sizeof(rack)); - static_cast(pGame)->setRackManual(false, convertToWc(rack)); + static_cast(pGame)->setRackManual(false, wfl(rack)); /* word */ token = strtok(NULL, delim); @@ -164,7 +164,7 @@ Game* Game::gameLoadFormat_14(FILE *fin, const Dictionary& iDic) //debug("%s)", token); strncat(pos, token, sizeof(pos) - strlen(pos) - 1); - if ((ret = pGame->play(convertToWc(pos), convertToWc(word)))) + if ((ret = pGame->play(wfl(pos), wfl(word)))) { GameFactory::Instance()->releaseGame(*pGame); char tmp1[10]; @@ -327,11 +327,11 @@ Game* Game::gameLoadFormat_15(FILE *fin, const Dictionary& iDic) // Build a rack for the correct player PlayedRack pldrack; - if (!iDic.validateLetters(convertToWc(rack))) + if (!iDic.validateLetters(wfl(rack))) { throw GameException("Rack invalid for the current dictionary"); } - pldrack.setManual(convertToWc(rack)); + pldrack.setManual(wfl(rack)); // Build a round Round round; @@ -339,7 +339,7 @@ Game* Game::gameLoadFormat_15(FILE *fin, const Dictionary& iDic) if (bonus == '*') round.setBonus(1); - wstring word = convertToWc(tmpWord); + wstring word = wfl(tmpWord); Tile tile; if (isalpha(ref[0])) { @@ -411,7 +411,7 @@ Game* Game::gameLoadFormat_15(FILE *fin, const Dictionary& iDic) { // Create the played rack PlayedRack pldrack; - pldrack.setManual(convertToWc(letters)); + pldrack.setManual(wfl(letters)); // Give the rack to the player pGame->m_players[nb]->setCurrentRack(pldrack); } diff --git a/game/navigation.cpp b/game/navigation.cpp index c7a23c8..af07d61 100644 --- a/game/navigation.cpp +++ b/game/navigation.cpp @@ -193,7 +193,7 @@ void Navigation::print() const int index = 0; BOOST_FOREACH(const Command *c, m_turnCommands) { - LOG_DEBUG(index << " " << convertToMb(c->toString())); + LOG_DEBUG(index << " " << lfw(c->toString())); ++index; } } diff --git a/game/rack.cpp b/game/rack.cpp index b634865..0be36b8 100644 --- a/game/rack.cpp +++ b/game/rack.cpp @@ -34,7 +34,7 @@ Rack::Rack() void Rack::remove(const Tile &t) { ASSERT(in(t), - "The rack does not contain the letter " + convertToMb(t.getDisplayStr())); + "The rack does not contain the letter " + lfw(t.getDisplayStr())); m_tiles[t.toCode()]--; m_ntiles--; } diff --git a/game/training.cpp b/game/training.cpp index 0ae33a6..edaa32f 100644 --- a/game/training.cpp +++ b/game/training.cpp @@ -109,7 +109,7 @@ int Training::play(const wstring &iCoord, const wstring &iWord) void Training::recordPlayerMove(const Move &iMove, Player &ioPlayer) { - LOG_INFO("Player " << ioPlayer.getId() << " plays: " << convertToMb(iMove.toString())); + LOG_INFO("Player " << ioPlayer.getId() << " plays: " << lfw(iMove.toString())); // Update the rack and the score of the current player // PlayerMoveCmd::execute() must be called before Game::helperPlayMove() // (called in this class in endTurn()). @@ -183,7 +183,7 @@ void Training::addPlayer(Player *iPlayer) ASSERT(getNPlayers() == 0, "Only one player can be added in Training mode"); // Force the name of the player - iPlayer->setName(convertToWc(_("Training"))); + iPlayer->setName(wfl(_("Training"))); Game::addPlayer(iPlayer); } diff --git a/game/xml_reader.cpp b/game/xml_reader.cpp index aaf6bab..12076f9 100644 --- a/game/xml_reader.cpp +++ b/game/xml_reader.cpp @@ -284,12 +284,12 @@ void XmlReader::endElement(const string& namespaceURI, throw LoadGameException("Rack invalid for the current dictionary: " + m_data); } pldrack.setManual(rackStr); - LOG_DEBUG("loaded rack: " << convertToMb(pldrack.toString())); + LOG_DEBUG("loaded rack: " << lfw(pldrack.toString())); Player &p = getPlayer(m_players, m_attributes["playerid"]); PlayerRackCmd *cmd = new PlayerRackCmd(p, pldrack); m_game->accessNavigation().addAndExecute(cmd); - LOG_DEBUG("rack: " << convertToMb(pldrack.toString())); + LOG_DEBUG("rack: " << lfw(pldrack.toString())); } else if (tag == "PlayerMove") diff --git a/game/xml_writer.cpp b/game/xml_writer.cpp index b8c9d1c..1225462 100644 --- a/game/xml_writer.cpp +++ b/game/xml_writer.cpp @@ -77,7 +77,7 @@ static void writeMove(ostream &out, const Move &iMove, else if (iMove.getType() == Move::PASS) out << "pass\" />"; else - throw SaveGameException("Unsupported move: " + convertToMb(iMove.toString())); + throw SaveGameException("Unsupported move: " + lfw(iMove.toString())); } void XmlWriter::write(const Game &iGame, const string &iFileName) @@ -197,7 +197,7 @@ void XmlWriter::write(const Game &iGame, const string &iFileName) else { // XXX - //throw SaveGameException("Unsupported command: " + convertToMb(cmd->toString())); + //throw SaveGameException("Unsupported command: " + lfw(cmd->toString())); } // TODO } diff --git a/utils/eliottxt.cpp b/utils/eliottxt.cpp index 094021b..d792982 100644 --- a/utils/eliottxt.cpp +++ b/utils/eliottxt.cpp @@ -376,9 +376,9 @@ void commonCommands(PublicGame &iGame, const vector &tokens) else { if (iGame.getDic().searchWord(word)) - printf("le mot -%s- existe\n", convertToMb(word).c_str()); + printf("le mot -%s- existe\n", lfw(word).c_str()); else - printf("le mot -%s- n'existe pas\n", convertToMb(word).c_str()); + printf("le mot -%s- n'existe pas\n", lfw(word).c_str()); } } else if (tokens[0][0] == L'h') @@ -431,7 +431,7 @@ void commonCommands(PublicGame &iGame, const vector &tokens) { try { - iGame.save(convertToMb(word)); + iGame.save(lfw(word)); } catch (std::exception &e) { @@ -477,7 +477,7 @@ void handleRegexp(const Dictionary& iDic, const vector &tokens) return; } - printf("search for %s (%d,%d,%d)\n", convertToMb(regexp).c_str(), + printf("search for %s (%d,%d,%d)\n", lfw(regexp).c_str(), nres, lmin, lmax); vector wordList; @@ -493,7 +493,7 @@ void handleRegexp(const Dictionary& iDic, const vector &tokens) BOOST_FOREACH(const wdstring &wstr, wordList) { - printf("%s\n", convertToMb(wstr).c_str()); + printf("%s\n", lfw(wstr).c_str()); } printf("%lu printed results\n", (long unsigned)wordList.size()); } @@ -518,7 +518,7 @@ void setSetting(const vector &tokens) try { - string setting = convertToMb(settingWide); + string setting = lfw(settingWide); if (type == L"i") { Settings::Instance().setInt(setting, wtoi(value.c_str())); @@ -596,7 +596,7 @@ void loopTraining(PublicGame &iGame) vector wordList; iGame.getDic().searchBenj(word, wordList); BOOST_FOREACH(const wdstring &wstr, wordList) - cout << convertToMb(wstr) << endl; + cout << lfw(wstr) << endl; } break; case L'p': @@ -607,10 +607,10 @@ void loopTraining(PublicGame &iGame) for (it = wordMap.begin(); it != wordMap.end(); ++it) { if (it->first != 0) - cout << "+" << convertToMb(iGame.getDic().getHeader().getDisplayStr(it->first)) << endl; + cout << "+" << lfw(iGame.getDic().getHeader().getDisplayStr(it->first)) << endl; BOOST_FOREACH(const wdstring &wstr, it->second) { - cout << " " << convertToMb(wstr) << endl; + cout << " " << lfw(wstr) << endl; } } } @@ -620,7 +620,7 @@ void loopTraining(PublicGame &iGame) vector wordList; iGame.getDic().searchRacc(word, wordList); BOOST_FOREACH(const wdstring &wstr, wordList) - cout << convertToMb(wstr) << endl; + cout << lfw(wstr) << endl; } break; } @@ -861,7 +861,7 @@ void mainLoop(const Dictionary &iDic) const wstring &wfileName = checkFileNameToken(tokens, 1); if (wfileName != L"") { - string filename = convertToMb(wfileName); + string filename = lfw(wfileName); try { PublicGame *game = PublicGame::load(filename, iDic); diff --git a/utils/game_io.cpp b/utils/game_io.cpp index 3dea793..89a025d 100644 --- a/utils/game_io.cpp +++ b/utils/game_io.cpp @@ -115,7 +115,7 @@ void GameIO::printBoardJoker(ostream &out, const PublicGame &iGame) { bool j = iGame.getBoard().isJoker(row, col); out << (j ? " ." : " ") - << convertToMb(iGame.getBoard().getDisplayStr(row, col)); + << lfw(iGame.getBoard().getDisplayStr(row, col)); } } out << endl; @@ -183,7 +183,7 @@ void GameIO::printBoardMultipliers2(ostream &out, const PublicGame &iGame) if (iGame.getBoard().isVacant(row, col)) out << "-"; else - out << convertToMb(iGame.getBoard().getDisplayStr(row, col)); + out << lfw(iGame.getBoard().getDisplayStr(row, col)); } out << endl; } @@ -197,7 +197,7 @@ void GameIO::printNonPlayed(ostream &out, const PublicGame &iGame) { if (bag.in(tile) > 9) out << " "; - out << setw(2) << convertToMb(tile.getDisplayStr()); + out << setw(2) << lfw(tile.getDisplayStr()); } out << endl; @@ -211,7 +211,7 @@ void GameIO::printNonPlayed(ostream &out, const PublicGame &iGame) void GameIO::printPlayedRack(ostream &out, const PublicGame &iGame, int __UNUSED__ n) { - out << convertToMb(iGame.getCurrentPlayer().getCurrentRack().toString(PlayedRack::RACK_SIMPLE)) << endl; + out << lfw(iGame.getCurrentPlayer().getCurrentRack().toString(PlayedRack::RACK_SIMPLE)) << endl; } @@ -220,7 +220,7 @@ void GameIO::printAllRacks(ostream &out, const PublicGame &iGame) for (unsigned int j = 0; j < iGame.getNbPlayers(); j++) { out << "Rack " << j << ": "; - out << convertToMb(iGame.getPlayer(j).getCurrentRack().toString(PlayedRack::RACK_EXTRA)) << endl; + out << lfw(iGame.getPlayer(j).getCurrentRack().toString(PlayedRack::RACK_EXTRA)) << endl; } } @@ -231,10 +231,10 @@ static void searchResultLine(ostream &out, const Results &iResults, int num) const wstring &word = r.getWord(); if (word.empty()) return; - out << convertToMb(word) << string(16 - word.size(), ' ') + out << lfw(word) << string(16 - word.size(), ' ') << (r.getBonus() ? '*' : ' ') << setw(4) << r.getPoints() - << ' ' << convertToMb(r.getCoord().toString()); + << ' ' << lfw(r.getCoord().toString()); } diff --git a/utils/ncurses.cpp b/utils/ncurses.cpp index 26199fd..3b2787d 100644 --- a/utils/ncurses.cpp +++ b/utils/ncurses.cpp @@ -257,12 +257,12 @@ void CursesIntf::drawBoard(WINDOW *win, int y, int x) const if (m_game->getBoard().isJoker(row, col)) { wattron(win, A_BOLD | COLOR_PAIR(COLOR_GREEN)); - mvwprintw(win, y + row + 1, x + 3 * col + 2 + offset, convertToMb(chr).c_str()); + mvwprintw(win, y + row + 1, x + 3 * col + 2 + offset, lfw(chr).c_str()); wattroff(win, A_BOLD); } else { - mvwprintw(win, y + row + 1, x + 3 * col + 2 + offset, convertToMb(chr).c_str()); + mvwprintw(win, y + row + 1, x + 3 * col + 2 + offset, lfw(chr).c_str()); } } else @@ -298,7 +298,7 @@ void CursesIntf::drawScoresRacks(WINDOW *win, int y, int x) const if (m_game->getMode() != PublicGame::kTRAINING && i == currId) attron(A_BOLD); mvwprintw(win, y + i + 1, x + 2, _("%s: %d"), - truncOrPad(convertToMb(m_game->getPlayer(i).getName()), + truncOrPad(lfw(m_game->getPlayer(i).getName()), maxForScores).c_str(), m_game->getPlayer(i).getPoints()); if (m_game->getMode() != PublicGame::kTRAINING && i == currId) @@ -320,7 +320,7 @@ void CursesIntf::drawScoresRacks(WINDOW *win, int y, int x) const attron(A_BOLD); wstring rack = m_game->getPlayer(i).getCurrentRack().toString(PlayedRack::RACK_SIMPLE); mvwprintw(win, y + yOff + i + 1, x + 2, _("%s: %ls"), - truncOrPad(convertToMb(m_game->getPlayer(i).getName()), + truncOrPad(lfw(m_game->getPlayer(i).getName()), maxForRacks).c_str(), rack.c_str()); if (m_game->getMode() != PublicGame::kTRAINING && i == currId) @@ -359,7 +359,7 @@ void CursesIntf::drawResults(Box &ioBox) const ioBox.printDataLine(i, x, "%3d %s %3s", r.getPoints(), padAndConvert(r.getWord(), ioBox.getWidth() - 9, false).c_str(), - convertToMb(coord).c_str()); + lfw(coord).c_str()); } // Complete the list with empty lines, to avoid trails for (; i < (unsigned int)ioBox.getLastLine(); i++) @@ -419,7 +419,7 @@ void CursesIntf::drawHistory(Box &ioBox) const // The move corresponds to a passed turn or changed letters wstring action; if (m.getType() == Move::PASS) - action = convertToWc(_("(PASS)")); + action = wfl(_("(PASS)")); else if (m.getType() == Move::CHANGE_LETTERS) action = L"(-" + m.getChangedLetters() + L")"; @@ -515,7 +515,7 @@ void CursesIntf::drawBag(Box &ioBox) const padAndConvert(allTiles[i].getDisplayStr(), 2).c_str(), allTiles[i].getPoints(), allTiles[i].maxNumber(), - convertToMb(str).c_str()); + lfw(str).c_str()); } int nbLines = min(i + 2 - ioBox.getFirstLine(), @@ -620,7 +620,7 @@ void CursesIntf::saveGame(WINDOW *win, int y, int x) char s[100]; try { - m_game->save(convertToMb(filename)); + m_game->save(lfw(filename)); snprintf(s, 100, _("Game saved in '%ls'"), filename.c_str()); drawStatus(win, s, false); } @@ -646,7 +646,7 @@ void CursesIntf::loadGame(WINDOW *win, int y, int x) { try { - PublicGame *loaded = PublicGame::load(convertToMb(filename), m_game->getDic()); + PublicGame *loaded = PublicGame::load(lfw(filename), m_game->getDic()); //GameFactory::Instance()->releaseGame(*m_game); delete m_game; m_game = loaded; @@ -751,7 +751,7 @@ bool CursesIntf::readString(WINDOW *win, int y, int x, int n, wstring &oString, int len = pos; x = x0; pos = 0; - mvwprintw(win, y, x0, "%s", convertToMb(oString + wstring(len, L' ')).c_str()); + mvwprintw(win, y, x0, "%s", lfw(oString + wstring(len, L' ')).c_str()); wmove(win, y, x); } else if (res == KEY_CODE_YES) @@ -761,13 +761,13 @@ bool CursesIntf::readString(WINDOW *win, int y, int x, int n, wstring &oString, x--; pos--; oString.erase(pos, 1); - mvwprintw(win, y, x0, "%s", convertToMb(oString + L" ").c_str()); + mvwprintw(win, y, x0, "%s", lfw(oString + L" ").c_str()); wmove(win, y, x); } else if (c == KEY_DC) { oString.erase(pos, 1); - mvwprintw(win, y, x0, "%s", convertToMb(oString + L" ").c_str()); + mvwprintw(win, y, x0, "%s", lfw(oString + L" ").c_str()); wmove(win, y, x); } else if (c == KEY_LEFT && pos != 0) @@ -801,14 +801,14 @@ bool CursesIntf::readString(WINDOW *win, int y, int x, int n, wstring &oString, { x++; oString.insert(pos++, 1, c); - mvwprintw(win, y, x0, "%s", convertToMb(oString).c_str()); + mvwprintw(win, y, x0, "%s", lfw(oString).c_str()); wmove(win, y, x); } else if (flag & kJOKER && c == L'?') { x++; oString.insert(pos++, 1, c); - mvwprintw(win, y, x0, "%s", convertToMb(oString).c_str()); + mvwprintw(win, y, x0, "%s", lfw(oString).c_str()); wmove(win, y, x); } else if (flag & kFILENAME) @@ -817,7 +817,7 @@ bool CursesIntf::readString(WINDOW *win, int y, int x, int n, wstring &oString, { x++; oString += c; - mvwprintw(win, y, x0, "%s", convertToMb(oString).c_str()); + mvwprintw(win, y, x0, "%s", lfw(oString).c_str()); wmove(win, y, x); } else