{
    This file is part of Chentrah,
    Copyright (C) 2004-2008 Anton Rzheshevski (chebmaster@mail.ru).

    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
    the Free Software Foundation, either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see http://www.gnu.org/licenses/

 **********************************************************************}


 var
   _UniToAnsiTable: array[0..$FFFF] of AnsiChar;
   _AnsiToUniTable: array[AnsiChar] of WideChar;

 procedure InitUnicode;
 
(* function AnsiToUni(s: AnsiString): TUni;
 function WideToUni(w: WideString): TUni;*)
 function WideToAnsi(u: WideString): AnsiString; overload;
 function AnsiToWide(a: AnsiString): WideString;
 function WideToCp1251(u: WideString): AnsiString; overload;
 function Cp1251ToWide(a: AnsiString): WideString;
 function Cp1251CharToWideChar(a: AnsiChar): WideChar;
 function TrimWideString (u: WideString): WideString;
 function WideReplace(u: WideString; a, b: AnsiString): WideString; overload;
 function WideReplace(u: WideString; a: AnsiString; b: WideString): WideString; overload;
 function WideReplace(u, a, b: WideString): WideString; overload;
 function WidePos(a, u: WideString): integer;

type
 WideStringArray = array of WideString;
 AnsiStringArray = array of AnsiString;
 function Explode(separator, s: WideString; TrimIt: system.boolean = false): WideStringArray; overload;
 function Explode(separator, s: AnsiString; TrimIt: system.boolean = false): AnsiStringArray; overload;
 function Implode(separator: AnsiString; a: AnsiStringArray): AnsiString; overload;
 function Implode(separator: WideString; a: WideStringArray): WideString; overload;
