<?php
// Copyright 1999-2017. Plesk International GmbH. All Rights Reserved.

namespace Plesk\MigrationLibV8\SiteImport\Entity;

class FtpServerEncodings
{
    private static $utf8Encoding = ['id' => 'utf-8', 'title' => 'UTF-8'];

    public static function getCodepagesList()
    {
        return [
            // List of codepages as accepted by backend (Python 2.7) - see
            // https://docs.python.org/2.7/library/codecs.html#standard-encodings
            // for details
            self::$utf8Encoding,
            ['id' => 'big5', 'title' => 'big5 (Traditional Chinese)'],
            ['id' => 'big5hkscs', 'title' => 'big5hkscs (Traditional Chinese)'],
            ['id' => 'cp037', 'title' => 'cp037 (English)'],
            ['id' => 'cp424', 'title' => 'cp424 (Hebrew)'],
            ['id' => 'cp437', 'title' => 'cp437 (English)'],
            ['id' => 'cp500', 'title' => 'cp500 (Western Europe)'],
            ['id' => 'cp720', 'title' => 'cp720 (Arabic)'],
            ['id' => 'cp737', 'title' => 'cp737 (Greek)'],
            ['id' => 'cp775', 'title' => 'cp775 (Baltic languages)'],
            ['id' => 'cp850', 'title' => 'cp850 (Western Europe)'],
            ['id' => 'cp852', 'title' => 'cp852 (Central and Eastern Europe)'],
            ['id' => 'cp855', 'title' => 'cp855 (Bulgarian, Byelorussian, Macedonian, Russian, Serbian)'],
            ['id' => 'cp856', 'title' => 'cp856 (Hebrew)'],
            ['id' => 'cp857', 'title' => 'cp857 (Turkish)'],
            ['id' => 'cp858', 'title' => 'cp858 (Western Europe)'],
            ['id' => 'cp860', 'title' => 'cp860 (Portuguese)'],
            ['id' => 'cp861', 'title' => 'cp861 (Icelandic)'],
            ['id' => 'cp862', 'title' => 'cp862 (Hebrew)'],
            ['id' => 'cp863', 'title' => 'cp863 (Canadian)'],
            ['id' => 'cp864', 'title' => 'cp864 (Arabic)'],
            ['id' => 'cp865', 'title' => 'cp865 (Danish, Norwegian)'],
            ['id' => 'cp866', 'title' => 'cp866 (Russian)'],
            ['id' => 'cp869', 'title' => 'cp869 (Greek)'],
            ['id' => 'cp874', 'title' => 'cp874 (Thai)'],
            ['id' => 'cp875', 'title' => 'cp875 (Greek)'],
            ['id' => 'cp932', 'title' => 'cp932 (Japanese)'],
            ['id' => 'cp949', 'title' => 'cp949 (Korean)'],
            ['id' => 'cp950', 'title' => 'cp950 (Traditional Chinese)'],
            ['id' => 'cp1006', 'title' => 'cp1006 (Urdu)'],
            ['id' => 'cp1026', 'title' => 'cp1026 (Turkish)'],
            ['id' => 'cp1140', 'title' => 'cp1140 (Western Europe)'],
            ['id' => 'cp1250', 'title' => 'cp1250 (Central and Eastern Europe)'],
            ['id' => 'cp1251', 'title' => 'cp1251 (Bulgarian, Byelorussian, Macedonian, Russian, Serbian)'],
            ['id' => 'cp1252', 'title' => 'cp1252 (Western Europe)'],
            ['id' => 'cp1253', 'title' => 'cp1253 (Greek)'],
            ['id' => 'cp1254', 'title' => 'cp1254 (Turkish)'],
            ['id' => 'cp1255', 'title' => 'cp1255 (Hebrew)'],
            ['id' => 'cp1256', 'title' => 'cp1256 (Arabic)'],
            ['id' => 'cp1257', 'title' => 'cp1257 (Baltic languages)'],
            ['id' => 'cp1258', 'title' => 'cp1258 (Vietnamese)'],
            ['id' => 'euc_jp', 'title' => 'euc_jp (Japanese)'],
            ['id' => 'euc_jis_2004', 'title' => 'euc_jis_2004 (Japanese)'],
            ['id' => 'euc_jisx0213', 'title' => 'euc_jisx0213 (Japanese)'],
            ['id' => 'euc_kr', 'title' => 'euc_kr (Korean)'],
            ['id' => 'gb2312', 'title' => 'gb2312 (Simplified Chinese)'],
            ['id' => 'gbk', 'title' => 'gbk (Unified Chinese)'],
            ['id' => 'gb18030', 'title' => 'gb18030 (Unified Chinese)'],
            ['id' => 'hz', 'title' => 'hz (Simplified Chinese)'],
            ['id' => 'iso2022_jp', 'title' => 'iso2022_jp (Japanese)'],
            ['id' => 'iso2022_jp_1', 'title' => 'iso2022_jp_1 (Japanese)'],
            ['id' => 'iso2022_jp_2', 'title' => 'iso2022_jp_2 (Japanese, Korean, Simplified Chinese, Western Europe, Greek)'],
            ['id' => 'iso2022_jp_2004', 'title' => 'iso2022_jp_2004 (Japanese)'],
            ['id' => 'iso2022_jp_3', 'title' => 'iso2022_jp_3 (Japanese)'],
            ['id' => 'iso2022_jp_ext', 'title' => 'iso2022_jp_ext (Japanese)'],
            ['id' => 'iso2022_kr', 'title' => 'iso2022_kr (Korean)'],
            ['id' => 'latin_1', 'title' => 'latin_1 (West Europe)'],
            ['id' => 'iso8859_2', 'title' => 'iso8859_2 (Central and Eastern Europe)'],
            ['id' => 'iso8859_3', 'title' => 'iso8859_3 (Esperanto, Maltese)'],
            ['id' => 'iso8859_4', 'title' => 'iso8859_4 (Baltic languages)'],
            ['id' => 'iso8859_5', 'title' => 'iso8859_5 (Bulgarian, Byelorussian, Macedonian, Russian, Serbian)'],
            ['id' => 'iso8859_6', 'title' => 'iso8859_6 (Arabic)'],
            ['id' => 'iso8859_7', 'title' => 'iso8859_7 (Greek)'],
            ['id' => 'iso8859_8', 'title' => 'iso8859_8 (Hebrew)'],
            ['id' => 'iso8859_9', 'title' => 'iso8859_9 (Turkish)'],
            ['id' => 'iso8859_10', 'title' => 'iso8859_10 (Nordic languages)'],
            ['id' => 'iso8859_11', 'title' => 'iso8859_11 (Thai languages)'],
            ['id' => 'iso8859_13', 'title' => 'iso8859_13 (Baltic languages)'],
            ['id' => 'iso8859_14', 'title' => 'iso8859_14 (Celtic languages)'],
            ['id' => 'iso8859_15', 'title' => 'iso8859_15 (Western Europe)'],
            ['id' => 'iso8859_16', 'title' => 'iso8859_16 (South-Eastern Europe)'],
            ['id' => 'johab', 'title' => 'johab (Korean)'],
            ['id' => 'koi8_r', 'title' => 'koi8_r (Russian)'],
            ['id' => 'koi8_u', 'title' => 'koi8_u (Ukrainian)'],
            ['id' => 'mac_cyrillic', 'title' => 'mac_cyrillic (Bulgarian, Byelorussian, Macedonian, Russian, Serbian)'],
            ['id' => 'mac_greek', 'title' => 'mac_greek (Greek)'],
            ['id' => 'mac_iceland', 'title' => 'mac_iceland (Icelandic)'],
            ['id' => 'mac_latin2', 'title' => 'mac_latin2 (Central and Eastern Europe)'],
            ['id' => 'mac_roman', 'title' => 'mac_roman (Western Europe)'],
            ['id' => 'mac_turkish', 'title' => 'mac_turkish (Turkish)'],
            ['id' => 'ptcp154', 'title' => 'ptcp154 (Kazakh)'],
            ['id' => 'shift_jis', 'title' => 'shift_jis (Japanese)'],
            ['id' => 'shift_jis_2004', 'title' => 'shift_jis_2004 (Japanese)'],
            ['id' => 'shift_jisx0213', 'title' => 'shift_jisx0213 (Japanese)'],
            ['id' => 'utf_32', 'title' => 'UTF-32'],
            ['id' => 'utf_32_be', 'title' => 'UTF-32BE'],
            ['id' => 'utf_32_le', 'title' => 'UTF-32LE'],
            ['id' => 'utf_16', 'title' => 'UTF-16'],
            ['id' => 'utf_16be', 'title' => 'UTF-16BE'],
            ['id' => 'utf_16le', 'title' => 'UTF-16LE'],
            ['id' => 'utf_7', 'title' => 'UTF-7'],
        ];
    }

    public static function getDefaultCodepage()
    {
        return self::$utf8Encoding;
    }
}
