libyui-ncurses  2.44.1
 All Classes Functions Variables
lang2encoding.cc
1 /*
2  Copyright (C) 2000-2012 Novell, Inc
3  This library is free software; you can redistribute it and/or modify
4  it under the terms of the GNU Lesser General Public License as
5  published by the Free Software Foundation; either version 2.1 of the
6  License, or (at your option) version 3.0 of the License. This library
7  is distributed in the hope that it will be useful, but WITHOUT ANY
8  WARRANTY; without even the implied warranty of MERCHANTABILITY or
9  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
10  License for more details. You should have received a copy of the GNU
11  Lesser General Public License along with this library; if not, write
12  to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
13  Floor, Boston, MA 02110-1301 USA
14 */
15 
16 
17 /*-/
18 
19  File: lang2encoding.cc
20 
21  Author: auto-generated
22 
23 /-*/
24 
25 #include <string>
26 
27 std::string language2encoding( std::string lang )
28 {
29  using std::string;
30  lang = ":" + lang + ":";
31  if ( std::string( ":ca:da:de:en:es:fi:fr:gl:is:it:nl:no:pt:sv:" ).find( lang ) != std::string::npos )
32  return "ISO-8859-1";
33  else if ( std::string( ":lt:" ).find( lang ) != std::string::npos )
34  return "ISO-8859-13";
35  else if ( std::string( ":cs:hr:hu:pl:ro:sk:sl:" ).find( lang ) != std::string::npos )
36  return "ISO-8859-2";
37  else if ( std::string( ":ru:" ).find( lang ) != std::string::npos )
38  return "ISO-8859-5";
39  else if ( std::string( ":el:" ).find( lang ) != std::string::npos )
40  return "ISO-8859-7";
41  else if ( std::string( ":iw:" ).find( lang ) != std::string::npos )
42  return "ISO-8859-8";
43  else if ( std::string( ":tr:" ).find( lang ) != std::string::npos )
44  return "ISO-8859-9";
45  else if ( std::string( ":ja:" ).find( lang ) != std::string::npos )
46  return "eucJP";
47  return "";
48 }
49 //-----------------------------------------------------------------