"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "utf8convert.h" between
xapian-omega-1.4.18.tar.xz and xapian-omega-1.4.19.tar.xz

About: Xapian Omega is an application built on Xapian, consisting of indexers and a CGI search frontend.

utf8convert.h  (xapian-omega-1.4.18.tar.xz):utf8convert.h  (xapian-omega-1.4.19.tar.xz)
/** @file /** @file
* @brief convert a string to UTF-8 encoding. * @brief convert a string to UTF-8 encoding.
*/ */
/* Copyright (C) 2006 Olly Betts /* Copyright (C) 2006,2021 Olly Betts
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
skipping to change at line 26 skipping to change at line 26
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#ifndef OMEGA_INCLUDED_UTF8CONVERT_H #ifndef OMEGA_INCLUDED_UTF8CONVERT_H
#define OMEGA_INCLUDED_UTF8CONVERT_H #define OMEGA_INCLUDED_UTF8CONVERT_H
#include <string> #include <string>
void convert_to_utf8(std::string & text, const std::string & charset); // Internal helper.
bool convert_to_utf8_(const std::string& text, const std::string& charset,
std::string& output);
// Convert in-place (avoids copy if already UTF-8).
inline void convert_to_utf8(std::string& text, const std::string& charset)
{
(void)convert_to_utf8_(text, charset, text);
}
inline void convert_to_utf8(const std::string& text, const std::string& charset,
std::string& output)
{
if (!convert_to_utf8_(text, charset, output))
output = text;
}
#endif // OMEGA_INCLUDED_UTF8CONVERT_H #endif // OMEGA_INCLUDED_UTF8CONVERT_H
 End of changes. 2 change blocks. 
2 lines changed or deleted 17 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)