[
  {
    "path": ".github/workflows/build.yml",
    "content": "# Build on push and PR events\non:\n  push:\n    branches:\n      - master\n    tags-ignore:\n      - '*'\n  pull_request:\n\njobs:\n  build:\n    runs-on: ubuntu-latest\n    steps:\n      - name: Checkout\n        uses: \"actions/checkout@v3\"\n\n      - name: Build with Gradle\n        run: ./gradlew build\n"
  },
  {
    "path": ".github/workflows/release.yml",
    "content": "# Release on new tags\non:\n  push:\n    tags:\n      - 'v*'\n\njobs:\n  release:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: \"actions/checkout@v3\"\n\n      - name: Get the tag version\n        id: version\n        run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/v}\n\n      - name: Create release\n        id: create_release\n        uses: actions/create-release@v1\n        env:\n          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n        with:\n          tag_name: ${{ github.ref }}\n          release_name: \"Version ${{ steps.version.outputs.VERSION }}\"\n          body: \"![Icon](src/main/res/drawable-xhdpi/ic_launcher.png)\"\n"
  },
  {
    "path": ".gitignore",
    "content": ".gradle/\nbuild/\nlocal.properties\n*.iml\n.idea/\ndata/\n*.orig\n*~\n*.apk\n"
  },
  {
    "path": "Charset.md",
    "content": "# Character set\n\n![Editor](https://github.com/billthefarmer/billthefarmer.github.io/raw/master/images/Editor-charset.png)\n\n## Default\nThe default character set is set to `UTF-8` on selecting **New** from\nthe toolbar. It may be changed in the menu. Android defaults to\n`UTF-8`, don't use anything else unless you are sure what you are\ndoing.\n\n## Detection\nThe current character set is optionally detected on reading a file by\nthe detection code from [International Components for\nUnicode](https://unicode-org.github.io/icu/userguide/icu4j). If there\nare no accented characters or symbols in the text to give the\ndetection algorithm something to work on it may not get it right.\n\n## Saving\nFiles will be saved using the current character set. To change it, use\nthe **Charset** item in the menu, which shows the current set.\n\n**Caution** &ndash; If you add accented characters or symbols to the\ntext, make sure to check the current character set before you save it.\n\n## Mode line\nThe character set may be set to `UTF-8` by using a mode line in the text.\n\n```\n# ed: cs:u\n```\n\nSee [Mode line](Mode.md) for details.\n"
  },
  {
    "path": "Chooser.md",
    "content": "# File Chooser\n\n![Editor](https://github.com/billthefarmer/billthefarmer.github.io/raw/master/images/Editor-chooser.png)\n\nThe chooser shows a scrollable row of folder buttons and a list of\nfiles with icons. Files which appear to be media files, or are too\nlarge will be disabled and not selectable. Touch a folder button or\nfolder to change folder, or a file to open a file. Hidden files\nbeginning with a '.'  will not appear.\n\nThe parent folder, if it exists, will appear first in the list. Touch\nthat folder to move up the directory tree. If a folder is not\naccessible, the chooser will show the parent folder, if it exists, and\nthe external storage folder (`/storage/emulated/0`).\n\nUse the **Storage** button to open files using the android file\nmanager. This should ensure that files on removeable SD cards can be\nsaved using the **Save** button. The file manager may refuse to open\nsome types of text files not recognised by android.\n"
  },
  {
    "path": "LICENSE",
    "content": "                    GNU GENERAL PUBLIC LICENSE\n                       Version 3, 29 June 2007\n\n Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>\n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n                            Preamble\n\n  The GNU General Public License is a free, copyleft license for\nsoftware and other kinds of works.\n\n  The licenses for most software and other practical works are designed\nto take away your freedom to share and change the works.  By contrast,\nthe GNU General Public License is intended to guarantee your freedom to\nshare and change all versions of a program--to make sure it remains free\nsoftware for all its users.  We, the Free Software Foundation, use the\nGNU General Public License for most of our software; it applies also to\nany other work released this way by its authors.  You can apply it to\nyour programs, too.\n\n  When we speak of free software, we are referring to freedom, not\nprice.  Our General Public Licenses are designed to make sure that you\nhave the freedom to distribute copies of free software (and charge for\nthem if you wish), that you receive source code or can get it if you\nwant it, that you can change the software or use pieces of it in new\nfree programs, and that you know you can do these things.\n\n  To protect your rights, we need to prevent others from denying you\nthese rights or asking you to surrender the rights.  Therefore, you have\ncertain responsibilities if you distribute copies of the software, or if\nyou modify it: responsibilities to respect the freedom of others.\n\n  For example, if you distribute copies of such a program, whether\ngratis or for a fee, you must pass on to the recipients the same\nfreedoms that you received.  You must make sure that they, too, receive\nor can get the source code.  And you must show them these terms so they\nknow their rights.\n\n  Developers that use the GNU GPL protect your rights with two steps:\n(1) assert copyright on the software, and (2) offer you this License\ngiving you legal permission to copy, distribute and/or modify it.\n\n  For the developers' and authors' protection, the GPL clearly explains\nthat there is no warranty for this free software.  For both users' and\nauthors' sake, the GPL requires that modified versions be marked as\nchanged, so that their problems will not be attributed erroneously to\nauthors of previous versions.\n\n  Some devices are designed to deny users access to install or run\nmodified versions of the software inside them, although the manufacturer\ncan do so.  This is fundamentally incompatible with the aim of\nprotecting users' freedom to change the software.  The systematic\npattern of such abuse occurs in the area of products for individuals to\nuse, which is precisely where it is most unacceptable.  Therefore, we\nhave designed this version of the GPL to prohibit the practice for those\nproducts.  If such problems arise substantially in other domains, we\nstand ready to extend this provision to those domains in future versions\nof the GPL, as needed to protect the freedom of users.\n\n  Finally, every program is threatened constantly by software patents.\nStates should not allow patents to restrict development and use of\nsoftware on general-purpose computers, but in those that do, we wish to\navoid the special danger that patents applied to a free program could\nmake it effectively proprietary.  To prevent this, the GPL assures that\npatents cannot be used to render the program non-free.\n\n  The precise terms and conditions for copying, distribution and\nmodification follow.\n\n                       TERMS AND CONDITIONS\n\n  0. Definitions.\n\n  \"This License\" refers to version 3 of the GNU General Public License.\n\n  \"Copyright\" also means copyright-like laws that apply to other kinds of\nworks, such as semiconductor masks.\n\n  \"The Program\" refers to any copyrightable work licensed under this\nLicense.  Each licensee is addressed as \"you\".  \"Licensees\" and\n\"recipients\" may be individuals or organizations.\n\n  To \"modify\" a work means to copy from or adapt all or part of the work\nin a fashion requiring copyright permission, other than the making of an\nexact copy.  The resulting work is called a \"modified version\" of the\nearlier work or a work \"based on\" the earlier work.\n\n  A \"covered work\" means either the unmodified Program or a work based\non the Program.\n\n  To \"propagate\" a work means to do anything with it that, without\npermission, would make you directly or secondarily liable for\ninfringement under applicable copyright law, except executing it on a\ncomputer or modifying a private copy.  Propagation includes copying,\ndistribution (with or without modification), making available to the\npublic, and in some countries other activities as well.\n\n  To \"convey\" a work means any kind of propagation that enables other\nparties to make or receive copies.  Mere interaction with a user through\na computer network, with no transfer of a copy, is not conveying.\n\n  An interactive user interface displays \"Appropriate Legal Notices\"\nto the extent that it includes a convenient and prominently visible\nfeature that (1) displays an appropriate copyright notice, and (2)\ntells the user that there is no warranty for the work (except to the\nextent that warranties are provided), that licensees may convey the\nwork under this License, and how to view a copy of this License.  If\nthe interface presents a list of user commands or options, such as a\nmenu, a prominent item in the list meets this criterion.\n\n  1. Source Code.\n\n  The \"source code\" for a work means the preferred form of the work\nfor making modifications to it.  \"Object code\" means any non-source\nform of a work.\n\n  A \"Standard Interface\" means an interface that either is an official\nstandard defined by a recognized standards body, or, in the case of\ninterfaces specified for a particular programming language, one that\nis widely used among developers working in that language.\n\n  The \"System Libraries\" of an executable work include anything, other\nthan the work as a whole, that (a) is included in the normal form of\npackaging a Major Component, but which is not part of that Major\nComponent, and (b) serves only to enable use of the work with that\nMajor Component, or to implement a Standard Interface for which an\nimplementation is available to the public in source code form.  A\n\"Major Component\", in this context, means a major essential component\n(kernel, window system, and so on) of the specific operating system\n(if any) on which the executable work runs, or a compiler used to\nproduce the work, or an object code interpreter used to run it.\n\n  The \"Corresponding Source\" for a work in object code form means all\nthe source code needed to generate, install, and (for an executable\nwork) run the object code and to modify the work, including scripts to\ncontrol those activities.  However, it does not include the work's\nSystem Libraries, or general-purpose tools or generally available free\nprograms which are used unmodified in performing those activities but\nwhich are not part of the work.  For example, Corresponding Source\nincludes interface definition files associated with source files for\nthe work, and the source code for shared libraries and dynamically\nlinked subprograms that the work is specifically designed to require,\nsuch as by intimate data communication or control flow between those\nsubprograms and other parts of the work.\n\n  The Corresponding Source need not include anything that users\ncan regenerate automatically from other parts of the Corresponding\nSource.\n\n  The Corresponding Source for a work in source code form is that\nsame work.\n\n  2. Basic Permissions.\n\n  All rights granted under this License are granted for the term of\ncopyright on the Program, and are irrevocable provided the stated\nconditions are met.  This License explicitly affirms your unlimited\npermission to run the unmodified Program.  The output from running a\ncovered work is covered by this License only if the output, given its\ncontent, constitutes a covered work.  This License acknowledges your\nrights of fair use or other equivalent, as provided by copyright law.\n\n  You may make, run and propagate covered works that you do not\nconvey, without conditions so long as your license otherwise remains\nin force.  You may convey covered works to others for the sole purpose\nof having them make modifications exclusively for you, or provide you\nwith facilities for running those works, provided that you comply with\nthe terms of this License in conveying all material for which you do\nnot control copyright.  Those thus making or running the covered works\nfor you must do so exclusively on your behalf, under your direction\nand control, on terms that prohibit them from making any copies of\nyour copyrighted material outside their relationship with you.\n\n  Conveying under any other circumstances is permitted solely under\nthe conditions stated below.  Sublicensing is not allowed; section 10\nmakes it unnecessary.\n\n  3. Protecting Users' Legal Rights From Anti-Circumvention Law.\n\n  No covered work shall be deemed part of an effective technological\nmeasure under any applicable law fulfilling obligations under article\n11 of the WIPO copyright treaty adopted on 20 December 1996, or\nsimilar laws prohibiting or restricting circumvention of such\nmeasures.\n\n  When you convey a covered work, you waive any legal power to forbid\ncircumvention of technological measures to the extent such circumvention\nis effected by exercising rights under this License with respect to\nthe covered work, and you disclaim any intention to limit operation or\nmodification of the work as a means of enforcing, against the work's\nusers, your or third parties' legal rights to forbid circumvention of\ntechnological measures.\n\n  4. Conveying Verbatim Copies.\n\n  You may convey verbatim copies of the Program's source code as you\nreceive it, in any medium, provided that you conspicuously and\nappropriately publish on each copy an appropriate copyright notice;\nkeep intact all notices stating that this License and any\nnon-permissive terms added in accord with section 7 apply to the code;\nkeep intact all notices of the absence of any warranty; and give all\nrecipients a copy of this License along with the Program.\n\n  You may charge any price or no price for each copy that you convey,\nand you may offer support or warranty protection for a fee.\n\n  5. Conveying Modified Source Versions.\n\n  You may convey a work based on the Program, or the modifications to\nproduce it from the Program, in the form of source code under the\nterms of section 4, provided that you also meet all of these conditions:\n\n    a) The work must carry prominent notices stating that you modified\n    it, and giving a relevant date.\n\n    b) The work must carry prominent notices stating that it is\n    released under this License and any conditions added under section\n    7.  This requirement modifies the requirement in section 4 to\n    \"keep intact all notices\".\n\n    c) You must license the entire work, as a whole, under this\n    License to anyone who comes into possession of a copy.  This\n    License will therefore apply, along with any applicable section 7\n    additional terms, to the whole of the work, and all its parts,\n    regardless of how they are packaged.  This License gives no\n    permission to license the work in any other way, but it does not\n    invalidate such permission if you have separately received it.\n\n    d) If the work has interactive user interfaces, each must display\n    Appropriate Legal Notices; however, if the Program has interactive\n    interfaces that do not display Appropriate Legal Notices, your\n    work need not make them do so.\n\n  A compilation of a covered work with other separate and independent\nworks, which are not by their nature extensions of the covered work,\nand which are not combined with it such as to form a larger program,\nin or on a volume of a storage or distribution medium, is called an\n\"aggregate\" if the compilation and its resulting copyright are not\nused to limit the access or legal rights of the compilation's users\nbeyond what the individual works permit.  Inclusion of a covered work\nin an aggregate does not cause this License to apply to the other\nparts of the aggregate.\n\n  6. Conveying Non-Source Forms.\n\n  You may convey a covered work in object code form under the terms\nof sections 4 and 5, provided that you also convey the\nmachine-readable Corresponding Source under the terms of this License,\nin one of these ways:\n\n    a) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by the\n    Corresponding Source fixed on a durable physical medium\n    customarily used for software interchange.\n\n    b) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by a\n    written offer, valid for at least three years and valid for as\n    long as you offer spare parts or customer support for that product\n    model, to give anyone who possesses the object code either (1) a\n    copy of the Corresponding Source for all the software in the\n    product that is covered by this License, on a durable physical\n    medium customarily used for software interchange, for a price no\n    more than your reasonable cost of physically performing this\n    conveying of source, or (2) access to copy the\n    Corresponding Source from a network server at no charge.\n\n    c) Convey individual copies of the object code with a copy of the\n    written offer to provide the Corresponding Source.  This\n    alternative is allowed only occasionally and noncommercially, and\n    only if you received the object code with such an offer, in accord\n    with subsection 6b.\n\n    d) Convey the object code by offering access from a designated\n    place (gratis or for a charge), and offer equivalent access to the\n    Corresponding Source in the same way through the same place at no\n    further charge.  You need not require recipients to copy the\n    Corresponding Source along with the object code.  If the place to\n    copy the object code is a network server, the Corresponding Source\n    may be on a different server (operated by you or a third party)\n    that supports equivalent copying facilities, provided you maintain\n    clear directions next to the object code saying where to find the\n    Corresponding Source.  Regardless of what server hosts the\n    Corresponding Source, you remain obligated to ensure that it is\n    available for as long as needed to satisfy these requirements.\n\n    e) Convey the object code using peer-to-peer transmission, provided\n    you inform other peers where the object code and Corresponding\n    Source of the work are being offered to the general public at no\n    charge under subsection 6d.\n\n  A separable portion of the object code, whose source code is excluded\nfrom the Corresponding Source as a System Library, need not be\nincluded in conveying the object code work.\n\n  A \"User Product\" is either (1) a \"consumer product\", which means any\ntangible personal property which is normally used for personal, family,\nor household purposes, or (2) anything designed or sold for incorporation\ninto a dwelling.  In determining whether a product is a consumer product,\ndoubtful cases shall be resolved in favor of coverage.  For a particular\nproduct received by a particular user, \"normally used\" refers to a\ntypical or common use of that class of product, regardless of the status\nof the particular user or of the way in which the particular user\nactually uses, or expects or is expected to use, the product.  A product\nis a consumer product regardless of whether the product has substantial\ncommercial, industrial or non-consumer uses, unless such uses represent\nthe only significant mode of use of the product.\n\n  \"Installation Information\" for a User Product means any methods,\nprocedures, authorization keys, or other information required to install\nand execute modified versions of a covered work in that User Product from\na modified version of its Corresponding Source.  The information must\nsuffice to ensure that the continued functioning of the modified object\ncode is in no case prevented or interfered with solely because\nmodification has been made.\n\n  If you convey an object code work under this section in, or with, or\nspecifically for use in, a User Product, and the conveying occurs as\npart of a transaction in which the right of possession and use of the\nUser Product is transferred to the recipient in perpetuity or for a\nfixed term (regardless of how the transaction is characterized), the\nCorresponding Source conveyed under this section must be accompanied\nby the Installation Information.  But this requirement does not apply\nif neither you nor any third party retains the ability to install\nmodified object code on the User Product (for example, the work has\nbeen installed in ROM).\n\n  The requirement to provide Installation Information does not include a\nrequirement to continue to provide support service, warranty, or updates\nfor a work that has been modified or installed by the recipient, or for\nthe User Product in which it has been modified or installed.  Access to a\nnetwork may be denied when the modification itself materially and\nadversely affects the operation of the network or violates the rules and\nprotocols for communication across the network.\n\n  Corresponding Source conveyed, and Installation Information provided,\nin accord with this section must be in a format that is publicly\ndocumented (and with an implementation available to the public in\nsource code form), and must require no special password or key for\nunpacking, reading or copying.\n\n  7. Additional Terms.\n\n  \"Additional permissions\" are terms that supplement the terms of this\nLicense by making exceptions from one or more of its conditions.\nAdditional permissions that are applicable to the entire Program shall\nbe treated as though they were included in this License, to the extent\nthat they are valid under applicable law.  If additional permissions\napply only to part of the Program, that part may be used separately\nunder those permissions, but the entire Program remains governed by\nthis License without regard to the additional permissions.\n\n  When you convey a copy of a covered work, you may at your option\nremove any additional permissions from that copy, or from any part of\nit.  (Additional permissions may be written to require their own\nremoval in certain cases when you modify the work.)  You may place\nadditional permissions on material, added by you to a covered work,\nfor which you have or can give appropriate copyright permission.\n\n  Notwithstanding any other provision of this License, for material you\nadd to a covered work, you may (if authorized by the copyright holders of\nthat material) supplement the terms of this License with terms:\n\n    a) Disclaiming warranty or limiting liability differently from the\n    terms of sections 15 and 16 of this License; or\n\n    b) Requiring preservation of specified reasonable legal notices or\n    author attributions in that material or in the Appropriate Legal\n    Notices displayed by works containing it; or\n\n    c) Prohibiting misrepresentation of the origin of that material, or\n    requiring that modified versions of such material be marked in\n    reasonable ways as different from the original version; or\n\n    d) Limiting the use for publicity purposes of names of licensors or\n    authors of the material; or\n\n    e) Declining to grant rights under trademark law for use of some\n    trade names, trademarks, or service marks; or\n\n    f) Requiring indemnification of licensors and authors of that\n    material by anyone who conveys the material (or modified versions of\n    it) with contractual assumptions of liability to the recipient, for\n    any liability that these contractual assumptions directly impose on\n    those licensors and authors.\n\n  All other non-permissive additional terms are considered \"further\nrestrictions\" within the meaning of section 10.  If the Program as you\nreceived it, or any part of it, contains a notice stating that it is\ngoverned by this License along with a term that is a further\nrestriction, you may remove that term.  If a license document contains\na further restriction but permits relicensing or conveying under this\nLicense, you may add to a covered work material governed by the terms\nof that license document, provided that the further restriction does\nnot survive such relicensing or conveying.\n\n  If you add terms to a covered work in accord with this section, you\nmust place, in the relevant source files, a statement of the\nadditional terms that apply to those files, or a notice indicating\nwhere to find the applicable terms.\n\n  Additional terms, permissive or non-permissive, may be stated in the\nform of a separately written license, or stated as exceptions;\nthe above requirements apply either way.\n\n  8. Termination.\n\n  You may not propagate or modify a covered work except as expressly\nprovided under this License.  Any attempt otherwise to propagate or\nmodify it is void, and will automatically terminate your rights under\nthis License (including any patent licenses granted under the third\nparagraph of section 11).\n\n  However, if you cease all violation of this License, then your\nlicense from a particular copyright holder is reinstated (a)\nprovisionally, unless and until the copyright holder explicitly and\nfinally terminates your license, and (b) permanently, if the copyright\nholder fails to notify you of the violation by some reasonable means\nprior to 60 days after the cessation.\n\n  Moreover, your license from a particular copyright holder is\nreinstated permanently if the copyright holder notifies you of the\nviolation by some reasonable means, this is the first time you have\nreceived notice of violation of this License (for any work) from that\ncopyright holder, and you cure the violation prior to 30 days after\nyour receipt of the notice.\n\n  Termination of your rights under this section does not terminate the\nlicenses of parties who have received copies or rights from you under\nthis License.  If your rights have been terminated and not permanently\nreinstated, you do not qualify to receive new licenses for the same\nmaterial under section 10.\n\n  9. Acceptance Not Required for Having Copies.\n\n  You are not required to accept this License in order to receive or\nrun a copy of the Program.  Ancillary propagation of a covered work\noccurring solely as a consequence of using peer-to-peer transmission\nto receive a copy likewise does not require acceptance.  However,\nnothing other than this License grants you permission to propagate or\nmodify any covered work.  These actions infringe copyright if you do\nnot accept this License.  Therefore, by modifying or propagating a\ncovered work, you indicate your acceptance of this License to do so.\n\n  10. Automatic Licensing of Downstream Recipients.\n\n  Each time you convey a covered work, the recipient automatically\nreceives a license from the original licensors, to run, modify and\npropagate that work, subject to this License.  You are not responsible\nfor enforcing compliance by third parties with this License.\n\n  An \"entity transaction\" is a transaction transferring control of an\norganization, or substantially all assets of one, or subdividing an\norganization, or merging organizations.  If propagation of a covered\nwork results from an entity transaction, each party to that\ntransaction who receives a copy of the work also receives whatever\nlicenses to the work the party's predecessor in interest had or could\ngive under the previous paragraph, plus a right to possession of the\nCorresponding Source of the work from the predecessor in interest, if\nthe predecessor has it or can get it with reasonable efforts.\n\n  You may not impose any further restrictions on the exercise of the\nrights granted or affirmed under this License.  For example, you may\nnot impose a license fee, royalty, or other charge for exercise of\nrights granted under this License, and you may not initiate litigation\n(including a cross-claim or counterclaim in a lawsuit) alleging that\nany patent claim is infringed by making, using, selling, offering for\nsale, or importing the Program or any portion of it.\n\n  11. Patents.\n\n  A \"contributor\" is a copyright holder who authorizes use under this\nLicense of the Program or a work on which the Program is based.  The\nwork thus licensed is called the contributor's \"contributor version\".\n\n  A contributor's \"essential patent claims\" are all patent claims\nowned or controlled by the contributor, whether already acquired or\nhereafter acquired, that would be infringed by some manner, permitted\nby this License, of making, using, or selling its contributor version,\nbut do not include claims that would be infringed only as a\nconsequence of further modification of the contributor version.  For\npurposes of this definition, \"control\" includes the right to grant\npatent sublicenses in a manner consistent with the requirements of\nthis License.\n\n  Each contributor grants you a non-exclusive, worldwide, royalty-free\npatent license under the contributor's essential patent claims, to\nmake, use, sell, offer for sale, import and otherwise run, modify and\npropagate the contents of its contributor version.\n\n  In the following three paragraphs, a \"patent license\" is any express\nagreement or commitment, however denominated, not to enforce a patent\n(such as an express permission to practice a patent or covenant not to\nsue for patent infringement).  To \"grant\" such a patent license to a\nparty means to make such an agreement or commitment not to enforce a\npatent against the party.\n\n  If you convey a covered work, knowingly relying on a patent license,\nand the Corresponding Source of the work is not available for anyone\nto copy, free of charge and under the terms of this License, through a\npublicly available network server or other readily accessible means,\nthen you must either (1) cause the Corresponding Source to be so\navailable, or (2) arrange to deprive yourself of the benefit of the\npatent license for this particular work, or (3) arrange, in a manner\nconsistent with the requirements of this License, to extend the patent\nlicense to downstream recipients.  \"Knowingly relying\" means you have\nactual knowledge that, but for the patent license, your conveying the\ncovered work in a country, or your recipient's use of the covered work\nin a country, would infringe one or more identifiable patents in that\ncountry that you have reason to believe are valid.\n\n  If, pursuant to or in connection with a single transaction or\narrangement, you convey, or propagate by procuring conveyance of, a\ncovered work, and grant a patent license to some of the parties\nreceiving the covered work authorizing them to use, propagate, modify\nor convey a specific copy of the covered work, then the patent license\nyou grant is automatically extended to all recipients of the covered\nwork and works based on it.\n\n  A patent license is \"discriminatory\" if it does not include within\nthe scope of its coverage, prohibits the exercise of, or is\nconditioned on the non-exercise of one or more of the rights that are\nspecifically granted under this License.  You may not convey a covered\nwork if you are a party to an arrangement with a third party that is\nin the business of distributing software, under which you make payment\nto the third party based on the extent of your activity of conveying\nthe work, and under which the third party grants, to any of the\nparties who would receive the covered work from you, a discriminatory\npatent license (a) in connection with copies of the covered work\nconveyed by you (or copies made from those copies), or (b) primarily\nfor and in connection with specific products or compilations that\ncontain the covered work, unless you entered into that arrangement,\nor that patent license was granted, prior to 28 March 2007.\n\n  Nothing in this License shall be construed as excluding or limiting\nany implied license or other defenses to infringement that may\notherwise be available to you under applicable patent law.\n\n  12. No Surrender of Others' Freedom.\n\n  If conditions are imposed on you (whether by court order, agreement or\notherwise) that contradict the conditions of this License, they do not\nexcuse you from the conditions of this License.  If you cannot convey a\ncovered work so as to satisfy simultaneously your obligations under this\nLicense and any other pertinent obligations, then as a consequence you may\nnot convey it at all.  For example, if you agree to terms that obligate you\nto collect a royalty for further conveying from those to whom you convey\nthe Program, the only way you could satisfy both those terms and this\nLicense would be to refrain entirely from conveying the Program.\n\n  13. Use with the GNU Affero General Public License.\n\n  Notwithstanding any other provision of this License, you have\npermission to link or combine any covered work with a work licensed\nunder version 3 of the GNU Affero General Public License into a single\ncombined work, and to convey the resulting work.  The terms of this\nLicense will continue to apply to the part which is the covered work,\nbut the special requirements of the GNU Affero General Public License,\nsection 13, concerning interaction through a network will apply to the\ncombination as such.\n\n  14. Revised Versions of this License.\n\n  The Free Software Foundation may publish revised and/or new versions of\nthe GNU General Public License from time to time.  Such new versions will\nbe similar in spirit to the present version, but may differ in detail to\naddress new problems or concerns.\n\n  Each version is given a distinguishing version number.  If the\nProgram specifies that a certain numbered version of the GNU General\nPublic License \"or any later version\" applies to it, you have the\noption of following the terms and conditions either of that numbered\nversion or of any later version published by the Free Software\nFoundation.  If the Program does not specify a version number of the\nGNU General Public License, you may choose any version ever published\nby the Free Software Foundation.\n\n  If the Program specifies that a proxy can decide which future\nversions of the GNU General Public License can be used, that proxy's\npublic statement of acceptance of a version permanently authorizes you\nto choose that version for the Program.\n\n  Later license versions may give you additional or different\npermissions.  However, no additional obligations are imposed on any\nauthor or copyright holder as a result of your choosing to follow a\nlater version.\n\n  15. Disclaimer of Warranty.\n\n  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY\nAPPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT\nHOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY\nOF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,\nTHE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\nPURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM\nIS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF\nALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n\n  16. Limitation of Liability.\n\n  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\nWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS\nTHE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY\nGENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE\nUSE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF\nDATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD\nPARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),\nEVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF\nSUCH DAMAGES.\n\n  17. Interpretation of Sections 15 and 16.\n\n  If the disclaimer of warranty and limitation of liability provided\nabove cannot be given local legal effect according to their terms,\nreviewing courts shall apply local law that most closely approximates\nan absolute waiver of all civil liability in connection with the\nProgram, unless a warranty or assumption of liability accompanies a\ncopy of the Program in return for a fee.\n\n                     END OF TERMS AND CONDITIONS\n\n            How to Apply These Terms to Your New Programs\n\n  If you develop a new program, and you want it to be of the greatest\npossible use to the public, the best way to achieve this is to make it\nfree software which everyone can redistribute and change under these terms.\n\n  To do so, attach the following notices to the program.  It is safest\nto attach them to the start of each source file to most effectively\nstate the exclusion of warranty; and each file should have at least\nthe \"copyright\" line and a pointer to where the full notice is found.\n\n    {one line to give the program's name and a brief idea of what it does.}\n    Copyright (C) {year}  {name of author}\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with this program.  If not, see <http://www.gnu.org/licenses/>.\n\nAlso add information on how to contact you by electronic and paper mail.\n\n  If the program does terminal interaction, make it output a short\nnotice like this when it starts in an interactive mode:\n\n    {project}  Copyright (C) {year}  {fullname}\n    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.\n    This is free software, and you are welcome to redistribute it\n    under certain conditions; type `show c' for details.\n\nThe hypothetical commands `show w' and `show c' should show the appropriate\nparts of the General Public License.  Of course, your program's commands\nmight be different; for a GUI interface, you would use an \"about box\".\n\n  You should also get your employer (if you work as a programmer) or school,\nif any, to sign a \"copyright disclaimer\" for the program, if necessary.\nFor more information on this, and how to apply and follow the GNU GPL, see\n<http://www.gnu.org/licenses/>.\n\n  The GNU General Public License does not permit incorporating your program\ninto proprietary programs.  If your program is a subroutine library, you\nmay consider it more useful to permit linking proprietary applications with\nthe library.  If this is what you want to do, use the GNU Lesser General\nPublic License instead of this License.  But first, please read\n<http://www.gnu.org/philosophy/why-not-lgpl.html>.\n"
  },
  {
    "path": "Mode.md",
    "content": "# Mode line\n\nIf a line of text is found within the first or last two or three lines\nof the file which matches the mode line pattern, the mode of the\neditor will be changed after the file is loaded. The pattern is one or\nmore text or punctuation characters, white space, the text `ed:`\nfollowed by one or more option patterns separated by white space.\n\n```\n# ed: [[no]vw] [[no]ww] [[no]sg] [[no]hs] [cs:u] [th:l|d|s|w|b|r] [ts:l|m|s] [tf:m|p|s]\n```\n\nThe initial text or punctuation characters are intended to be used to\nhide the mode line from compilers and interpreters by commenting it\nout.\n\nThe option patterns are:\n\n * **[no]vw** &ndash; View files read only\n * **[no]ww** &ndash; Word wrap\n * **[no]sg** &ndash; Suggestions\n * **[no]hs** &ndash; Syntax highlighting\n * **cs:u** &ndash; Character set &ndash; UTF-8\n * **th:l|d|s|w|b|r** &ndash; Theme &ndash; light, dark, system,\n   white, black or retro\n * **ts:l|m|s** &ndash; Text size &ndash; large, medium or small\n * **tf:m|p|s** &ndash; Typeface &ndash; monospace, proportional\n   (sans) or serif\n\nThe mode line is read after the file is loaded and will change\nimmediately, except in Android 6, Marshmallow due to an obscure\nbug. Rotate the device to change mode.\n"
  },
  {
    "path": "README.md",
    "content": "# ![Logo](src/main/res/drawable-hdpi/ic_launcher.png) Editor ![.github/workflows/build.yml](https://github.com/billthefarmer/editor/workflows/.github/workflows/build.yml/badge.svg) [![Release](https://img.shields.io/github/release/billthefarmer/editor.svg?logo=github)](https://github.com/billthefarmer/editor/releases)\n[<img src=\"https://fdroid.gitlab.io/artwork/badge/get-it-on.svg\" alt=\"Get it on F-Droid\" height=\"80\">](https://f-droid.org/packages/org.billthefarmer.editor)\n\nAndroid simple generic text editor. The app is available from\n[F-Droid](https://f-droid.org/packages/org.billthefarmer.editor)\nand [here](https://github.com/billthefarmer/editor/releases)\n\n### Issues\nThere have been a number of issues raised on this app where users have\nobviously not read this README, looked at the\n[documentation](https://billthefarmer.github.io/editor/), or looked at\nold closed issues. Please read the README, read the\n[docs](https://billthefarmer.github.io/editor/), and look at the old\nissues before raising another one, you can search the issues from the\nbox at the top.\n\n### Large files\nEditor loads the whole of file to be edited into memory. It will not\nload large files (larger than ~500Kb) which would cause performance\nissues or cause the app to crash. Please do not raise issues about\nthe **Too large** dialog shown when attempting to load a large file.\n\n![Editor](https://github.com/billthefarmer/billthefarmer.github.io/raw/master/images/Editor.png) ![Editor](https://github.com/billthefarmer/billthefarmer.github.io/raw/master/images/Editor-chooser.png)\n\n![Editor](https://github.com/billthefarmer/billthefarmer.github.io/raw/master/images/Editor-landscape.png)\n\n![Editor](https://github.com/billthefarmer/billthefarmer.github.io/raw/master/images/Editor-syntax.png)\n\nThis is a fairly simple generic text editor which may be used\nstandalone or to show or edit any sort of text file from another\napp. If you select a text file in a file manager or similar app you\nwill be offered the option of using this editor along with whatever\nother apps you have installed that can show or edit a text file. Files\nwill initially be opened read only, long touch on the display or touch\nthe edit item in the toolbar to enable editing.\n\nThere are five toolbar items which may appear:\n* **Edit** &ndash; Edit the current read only file\n* **View** &ndash; View the current file read only\n* **Save** &ndash; Save the current file if modified\n* **New** &ndash; Start a new empty file\n* **Open** &ndash; Open a text file using a chooser\n\nAnd on the menu:\n* **Open recent** &ndash; Pop up a list of recent files\n  * **Clear list** &ndash; Clear list of recent files\n* **Search** &ndash; Interactive search of text using a regular\n    expression\n* **Find all** &ndash; Find all recent files containing search text\n* **Save as** &ndash; Save the current file with a new name\n* **Go to** &ndash; Scroll to selected position in file\n* **Print** &ndash; Print current file\n* **View markdown** &ndash; View markdown in browser or html viewer\n* **Charset** &ndash; Change the current character set, shows current set\n* **Options** &ndash; Select options\n  * **View files** &ndash; Open files read only for viewing\n  * **Open last** &ndash; Open last opened file on startup\n  * **Auto save** &ndash; Save the current file on app pause\n  * **Word wrap** &ndash; Limit text width to screen width and word wrap\n  * **Suggestions** &ndash; Text input and spelling suggestions\n  * **Highlight syntax** &ndash; Highlight programming language syntax\n* **Theme** &ndash; Choose theme\n  * **Light**\n  * **Dark**\n  * **System**\n  * **White**\n  * **Black**\n  * **Retro**\n* **Text size** &ndash; Choose text size\n  * **Small**\n  * **Medium**\n  * **Large**\n* **Typeface** &ndash; Choose typeface\n* **About** &ndash; Show version, copyright and licence\n\n### Edit\nEdit the current read only text.\n\n### View\nView the current file read only.\n\n### Save\nSave the current file if modified.\n\n### New\nStart a new empty file. Use the **Save as** item to save the new file.\n\n### Open\nChoose a file to open from the chooser dialog that pops up. The parent\nfolder will be the first in the list. See [File\nChooser](Chooser.md). The file will initially be read-only. Touch the\n**Edit** toolbar item to enable editing.\n\n### Open recent\nChoose a file from the list that pops up. As above the file will\ninitially be read only. The last entry, **Clear list**, will clear the\nlist.\n\n### Save as\nUse the dialog and the **Save** button or the **Storage** button to\nuse the android file manager to save the file.\n\n### Search\nEnter search text in the field that pops up in the toolbar. The first\nmatching item will be highlighted. Use the search button in the\nkeyboard for find next. The exact regular expression syntax used is in\nthe android documentation for\n[Pattern](https://developer.android.com/reference/java/util/regex/Pattern#sum).\nOdd text patterns unlikely to be found in an ordinary source file can\nhang the regex functionality so the app stops working. There is no way\nto predict or recover from this.\n\n### Find all\nYou may find all recent files that contain the current search\ntext. This menu item will only appear while the search widget is\nactive. A dialog will pop up with a list of matching files. Touch an\nentry to open that file. You may repeat this or refine the search text\nto find the desired file.\n\n### Go to\nSelect position in the current file on the horizontal seek bar in the\ndialog which will pop up.\n\n### Print\nPrint the current file. If you would like the output highlighted, you\nwill need to scroll slowly through the whole file to give the app a\nchance to highlight it. **Caution** &ndash; Attempting to print a\nlarge file on an older device with limited resources may cause the app\nto stop responding.\n\n### View markdown\nYou will be prompted to choose a viewer for an html file containing\nthe encoded markdown from the current open file. If the text contains\nno markdown the result will be the same text.\n\n### Shortcuts\nYou may create a **New file** or an **Open file** shortcut in the\nlauncher. The **New file** widget will create an shortcut to open a\nnew file in Editor. The **Open file** widget will pop up a dialog\nshowing the file chooser. You may choose a file or use the **Storage**\nbutton. You may cancel and fill in the name and path fields, or edit\nthe name or path fields after choosing a file. Use the **Create**\nbutton to create the shortcut. **Note** &ndash; content URIs returned\nby the android file picker will not be resolved.\n\n### Regular expressions\nExplaining [regular\nexpressions](https://en.wikipedia.org/wiki/Regular_expression) used in\nthe text search is beyond the scope of this README. There is at least\none\n[book](https://www.oreilly.com/library/view/mastering-regular-expressions/0596528124/)\ndevoted to the subject. Use `(?i)` for case insensitive search.\n\n### Character set\nThe current character set is displayed under the current file\nname. The character set is optionally detected when a new file is\nread. It may be changed by selecting the **Charset** item in the menu,\nwhich shows the current character set. See [Character\nset](Charset.md).\n\n### Typeface\nThe **Typeface** menu item shows a choice of common typefaces. These\nare aliases for the fonts commonly provided on android devices. Some\nof them resolve to the same font, depending on the device.\n\n### Highlight syntax\nIf the current open file is a C, C++, Objective C, Go, Dart, Java,\nJavascript, Python, Shell script, Swift, Rust, CSS, HTML, Org or\nMarkdown file, the keywords, classes comments, strings, etc will be\nhighlighted. See [Syntax Highlighting](Syntax.md).\n\n### Mode line\nIf a line of text is found within the first or last two or three lines\nof the file which matches the mode line pattern, the mode of the\neditor will be changed after the file is loaded. See [Mode\nline](Mode.md).\n```\n# ed: [[no]vw] [[no]ww] [[no]sg] [[no]hs] [cs:u] [th:l|d|s|w|b|r] [ts:l|m|s] [tf:m|p|s]\n```\n\n### Word count\nThe file word count and character count are shown in the toolbar. Due\nto the algorithm used, the result may differ from that produced by\nother utilities.\n\n### Extended selection\nIf the file being edited is not a plain text file, selections created\nby double tapping or long touching on the text will be extended to\nenclosing delimiters (brackets, quotes) on the same text line.\n\n### Text size\nText size may be changed from the menu or by pinch or expand gestures\non the text or by doubletap and swipe. The response to gestures on\nlarge files may be slow or delayed.\n\n### Unsaved file\nIf you touch the new, back or open button, and the current file has been\nmodified, you will be prompted whether you want to save it, else the\neditor will just exit or open a file chooser. The current file may be\nsaved on app pause using the menu option. The scroll position and name\nwill be remembered for the last 10 files opened.\n\n### Changed file\nIf a file has changed in storage while it was open in the editor, if\nyou attempt to save it, or the app is resumed, you will be prompted\nwhether to overwrite or reload the file.\n\n### Default file\nIf there is no open file any text entered will by default be saved in\n`Documents/Editor.txt`. This file will be loaded on start if it\nexists. Use the `Save as` menu item to save it elsewhere.\n\n### Shared file\nText files opened or shared by another app may be viewed and\nedited. Some apps may share files or text using a `content` URI that\nis not resolvable to a path to a file in storage. In that case the\neditor will read the file into a new file. The **Save** item will save\nthe file in the original location if possible.\n\n**Note** &ndash; Apps that share files will usually only give another\napp read permission. Use the **Save as** menu item to save the file\nelsewhere.\n\n### Keyboard shortcuts\nWhen using an external keyboard, some keyboard shortcuts are\nimplemented:\n * Ctrl+E &ndash; Edit mode\n * Ctrl+Shift+E &ndash; View mode\n * Ctrl+F &ndash; Search\n * Ctrl+Shift+F &ndash; Close search\n * Ctrl+Alt+F &ndash; Find next\n * Ctrl+G &ndash; Go to\n * Ctrl+M &ndash; Show menu\n * Ctrl+N &ndash; New file\n * Ctrl+O &ndash; Open file\n * Ctrl+S &ndash; Save file\n * Ctrl+Shift+S &ndash; Save as\n * Ctrl++ &ndash; Increase text size\n * Ctrl+- &ndash; Decrease text size\n * F3 &ndash; Find next\n * F10 &ndash; Show menu\nMany other shortcuts &ndash; Ctrl+A, Ctrl+C, Ctrl+V, Ctrl+X, Ctrl+Z\nare already build in to android.\n\n### SD cards\nAndroid allows removable SD cards to be used like a USB stick or as\npart of the device storage. Files opened using the file chooser on a\nremovable SD card may not save successfully using the save button. Use\nthe **Save as** menu item and the **Storage** button to save it using\nthe android file manager. Alternatively use the **Storage** button on\nthe file chooser dialog to open the file using the android file\nmanager. See [File Chooser](Chooser.md).\n"
  },
  {
    "path": "Syntax.md",
    "content": "# Syntax Highlighting\n\n## Selection\nThe type of highlighting is selected by file extension. Files with\n`.c`, `.cc`, `.c++`, `.cxx`, `.m`, `.h`, `.go`, `.js`, `.java`, `.py`,\n`.sh`, `.swift` extensions will be highlighted with 'C' style\nhighlighting. Files with `.htm`, `.html` extensions will be\nhighlighted as HTML. Files with `.cs`, `.css` extensions will be\nhighlighted as CSS. Files with `.org` extension will be highlighted as\nEmacs Org. Files with `.md` extensions will be highlighted as\nmarkdown.\n\n## Parsing\nThe algorithm makes no attempt at parsing. The text is scanned for\nrelevent keywords, classes, constants, strings and comments and\nhighlighted accordingly. Therefore it will not be exactly correct, but\ngood enough for a simple text editor. See [Source Code Syntax\nHighlighting][1].\n\n### C type\nKeywords and types are matched from lists of C/C++/Objective\nC/Dart/Go/Java/Javascript/Python/Shell/Swift/Rust keywords and\ntypes. Classes are capitalised words. Constants are all caps\nwords. Strings are in double quotes. Single quotes are ignored because\napostrophes break the algorithm. Both `/* */` and `// ` C style\ncomments and `# ` Shell script style comments are recognised.\n\n### HTML\nHTML keywords are matched from a list. Double quoted arguments are\nhighlighted. As above, single quotes are ignored. HTML comments `<!--\n-->` are recognised.\n\n### CSS\nCSS style names are matched from a list. Double quoted arguments are\nhighlighted. As above, single quotes are ignored. C style comments are\nrecognised.\n\n### Emacs Org\nMetadata, headers, links, emphasis and inline code will be highlighted.\n\n### Markdown\nMarkdown headers, links, emphasis and code will be highlighted.\n\n### Default\nFiles with unrecognised extensions which are not plain text files\nwill be highlighted with default highlighting, similar to C type\nhighlighting. Comments will not be highlighted as there is little\nconsistency with comment delimiters outside C type languages.\n\n**Caution** Files with strings of symbols may defeat the\nregex processing and cause the app to stop responding.\n\n## Limitations\nBecause scanning and highlighting a large file can be quite slow,\nmaking the app unresponsive, only the text currently in view is\nscanned and highlighted. Therefore as the text is edited or scrolled,\nthe new region in view will be scanned and highlighted after a short\ndelay to allow for user typing without the highlighting running\nconstantly.\n\n### Scrolling\nAfter the text is highlighted, the android view system will re-layout\nthe views whether they need it or not. That causes the current cursor\nposition to be scrolled back into view, which can be extremely\nannoying. So the cursor is moved if necessary to keep it within the\nvisible region.\n\n### Horizontal scrolling\nOn devices running android versions less than Marshmallow M (6),\nhorizontal scrolling will scroll back again. Make the text size\nsmaller or rotate the device to avoid this. Or turn the highlighting\noff.\n\n [1]: https://billthefarmer.github.io/blog/post/source-code-highlighting (https://billthefarmer.github.io/blog/post/source-code-highlighting)\n"
  },
  {
    "path": "build.gradle",
    "content": "buildscript {\n    repositories {\n        mavenCentral()\n        google()\n    }\n\n    dependencies {\n        classpath 'com.android.tools.build:gradle:8.13.2'\n    }\n}\n\nallprojects {\n    repositories {\n        mavenCentral()\n        google()\n    }\n\n    tasks.withType(JavaCompile) {\n        options.deprecation = true\n    }\n}\n\napply plugin: 'com.android.application'\n\nandroid {\n    compileSdkVersion 35\n    namespace = \"org.billthefarmer.editor\"\n\n    defaultConfig {\n        applicationId \"org.billthefarmer.editor\"\n        minSdkVersion 21\n        targetSdkVersion 35\n        versionName \"1.97\"\n        versionCode 197\n\n        buildConfigField \"long\", \"BUILT\", System.currentTimeMillis() + \"L\"\n    }\n\n    compileOptions {\n        sourceCompatibility JavaVersion.VERSION_1_9\n        targetCompatibility JavaVersion.VERSION_1_9\n    }\n\n    buildFeatures {\n        buildConfig = true\n    }\n\n    lintOptions {\n        disable 'ScopedStorage', 'OldTargetApi', 'NonConstantResourceId', 'UnusedResources',\n\t\t'AndroidGradlePluginVersion', 'GradleDependency', 'DiscouragedApi' \n        // abortOnError false\n    }\n}\n\ndependencies {\n    implementation 'org.commonmark:commonmark:0.27.1'\n}\n"
  },
  {
    "path": "docs/404.html",
    "content": "<!DOCTYPE html>\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en-gb\" lang=\"en-gb\">\n<head>\n  <meta name=\"generator\" content=\"Hugo 0.159.0\">\n\n  <meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\">\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, maximum-scale=1\">\n\n  <title>Editor</title>\n\n  <link rel=\"shortcut icon\" href=\"favicon.ico\" type=\"image/x-icon\">\n  <link href=\"https://fonts.googleapis.com/css?family=Open+Sans\" rel=\"stylesheet\">\n  <link rel=\"stylesheet\" href=\"https://billthefarmer.github.io/editor/css/styles.css\">\n  <link rel=\"stylesheet\" href=\"https://billthefarmer.github.io/editor/css/custom.css\">\n  <link href=\"\" rel=\"alternate\" type=\"application/rss+xml\" title=\"Editor\" />\n  <script type=\"text/javascript\">\n    window.onload = function() {\n        let p = document.getElementById(\"version\");\n        let d = new Date().getFullYear();\n        p.innerHTML = p.innerHTML.replace(/\\d{4}/, d);\n    }\n  </script>\n</head>\n<body>\n\n<style>\n    .not-found {\n        display: flex;\n        flex-direction: column;\n        justify-content: center;\n        align-items: center;\n        text-align: center;\n        min-height: 100vh;\n        font-size: 200%;\n        text-decoration: none;\n        color: #363636;\n    }\n\n    .not-found a {\n        display: inline-block;\n    }\n</style>\n<a href=\"https://billthefarmer.github.io/editor/\" class=\"not-found\">\n    Well, a fine little mess. Easy in, easy out. Another triumph.\n</a>\n</body>\n</html>\n\n"
  },
  {
    "path": "docs/categories/index.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>\n<rss version=\"2.0\" xmlns:atom=\"http://www.w3.org/2005/Atom\">\n  <channel>\n    <title>Categories on Editor</title>\n    <link>https://billthefarmer.github.io/editor/categories/</link>\n    <description>Recent content in Categories on Editor</description>\n    <generator>Hugo</generator>\n    <language>en-gb</language>\n    <copyright>Copyright &amp;copy; 2006 Bill Farmer</copyright>\n    <atom:link href=\"https://billthefarmer.github.io/editor/categories/index.xml\" rel=\"self\" type=\"application/rss+xml\" />\n  </channel>\n</rss>\n"
  },
  {
    "path": "docs/css/custom.css",
    "content": "table, th, td {\n    border: none;\n}\n\ntd {\n    vertical-align: top;\n    padding: 0;\n}\n\nsection.page h1,\nsection.page h3 {\n    border: none;\n    padding: 0;\n}\n\nsection.page h3 a,\nsection.page h3 a:hover,\nsection.page h3 a:visited {\n  text-decoration: none;\n}\n"
  },
  {
    "path": "docs/css/styles.css",
    "content": "html, body {\n  font-family: \"Open Sans\", sans-serif;\n  color: #363636;\n  height: 100%;\n}\n\n@media (min-width: 48em) {\n  html {\n    font-size: 16px;\n  }\n}\n\n@media (min-width: 58em) {\n  html {\n    font-size: 20px;\n  }\n}\n\n@media (min-width: 48em) {\n  .content {\n    margin-left: 21rem;\n    margin-right: 2rem;\n  }\n}\n\n@media (min-width: 64em) {\n  .content {\n    margin-left: 22rem;\n    margin-right: 3rem;\n  }\n}\n\n/* Sidebar */\n.sidebar {\n  overflow: auto;\n  text-align: center;\n  padding: 1rem 1rem;\n  color: white;\n  background-color: #363636;\n  display: flex;\n  flex-direction: column;\n}\n.sidebar.sidebar-default {\n  background-color: #363636;\n}\n.sidebar.sidebar-green {\n  background-color: #459D61;\n}\n.sidebar.sidebar-purple {\n  background-color: #77518A;\n}\n.sidebar.sidebar-pink {\n  background-color: #AD6AA9;\n}\n.sidebar.sidebar-red {\n  background-color: #B05353;\n}\n.sidebar.sidebar-cyan {\n  background-color: #5399B0;\n}\n.sidebar.sidebar-blue {\n  background-color: #5378B0;\n}\n.sidebar.sidebar-grey {\n  background-color: #959492;\n}\n.sidebar.sidebar-orange {\n  background-color: #DAA35C;\n}\n@media (min-width: 48em) {\n  .sidebar {\n    position: fixed;\n    top: 0;\n    left: 0;\n    bottom: 0;\n    width: 19rem;\n    text-align: left;\n  }\n}\n\n.site-title {\n  margin-top: 0px;\n}\n\n.sidebar a,\n.sidebar a:hover,\n.sidebar a:visited {\n  text-decoration: none;\n  color: white;\n}\n\n.sidebar a:hover {\n  color: rgb(223, 223, 223);;\n}\n\n.sidebar ul {\n  margin: 0px;\n  padding: 0px;\n}\n\n.sidebar ul li {\n  list-style: none;\n  padding-left: 2em;\n}\n\nnav {\n  margin: 1em 0 1em 0;\n}\n\n.sidebar .navigation {\n  flex: 1 0 auto;\n}\n\n.sidebar .version {\n  font-size: 80%;\n  text-align: right;\n  padding: 2px;\n}\n\n.sidebar .external-title {\n  margin-top: 2em;\n  text-align: center;\n  font-size: 120%;\n}\n\n.sidebar nav.external {\n  font-size: 80%;\n}\n\n/* Blocks */\n.block {\n  margin: 1em 0em 1em 0em;\n  padding: 0 5px 5px 5px;\n  border-top: 34px solid;\n  position: relative;\n  overflow-wrap: break-word;\n}\n\n.block:before {\n  position: absolute;\n  top: -32px;\n  left: 10px;\n  color: white;\n}\n\n.block.tip {\n  background: #e8f7e6;\n  border-top-color: #84c578;\n}\n\n.block.block.tip:before {\n  content: \"Tip\";\n}\n\n.block.note {\n  background: #e6f3fb;\n  border-top-color: #6bb1e0;\n}\n\n.block.block.note:before {\n  content: \"Note\";\n}\n\n.block.info {\n  background: #fefaf5;\n  border-top-color: #f1b37e;\n}\n\n.block.block.info:before {\n  content: \"Info\";\n}\n\n.block.warn {\n  background: #fbeded;\n  border-top-color: #d58181;\n}\n\n.block.block.warn:before {\n  content: \"Warning\";\n}\n\n/* Section of the page */\nsection.page {\n  margin-bottom: 3em;\n}\n\nsection.page h1 {\n  border-left: 3px solid #363636;\n  padding-left: 0.5em;\n  margin-bottom: 0;\n}\n\nsection.page .content {\n  margin-left: 0.5em;\n}\n\nsection.page h1 a,\nsection.page h1 a:hover,\nsection.page h1 a:visited {\n  text-decoration: none;\n  color: #363636;\n}\n\nsection.page a,\nsection.page a:hover,\nsection.page a:visited {\n  color: #363636;\n}\n\nsection div pre {\n  overflow: auto;\n}\n\nsection code {\n  background-color: #fafafa;\n}\n\nsection img {\n  max-width: 100%;\n}\n\ntable {\n    border-collapse: collapse;\n}\n\ntable,th, td {\n  border: 1px solid black;\n}\n\ntd{\n  padding: 5px;\n}\n"
  },
  {
    "path": "docs/index.html",
    "content": "<!DOCTYPE html>\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en-gb\" lang=\"en-gb\">\n<head>\n  <meta name=\"generator\" content=\"Hugo 0.159.0\">\n\n  <meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\">\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, maximum-scale=1\">\n\n  <title>Editor</title>\n\n  <link rel=\"shortcut icon\" href=\"favicon.ico\" type=\"image/x-icon\">\n  <link href=\"https://fonts.googleapis.com/css?family=Open+Sans\" rel=\"stylesheet\">\n  <link rel=\"stylesheet\" href=\"https://billthefarmer.github.io/editor/css/styles.css\">\n  <link rel=\"stylesheet\" href=\"https://billthefarmer.github.io/editor/css/custom.css\">\n  <link href=\"/editor/index.xml\" rel=\"alternate\" type=\"application/rss+xml\" title=\"Editor\" />\n  <script type=\"text/javascript\">\n    window.onload = function() {\n        let p = document.getElementById(\"version\");\n        let d = new Date().getFullYear();\n        p.innerHTML = p.innerHTML.replace(/\\d{4}/, d);\n    }\n  </script>\n</head>\n<body>\n\n<div class=\"sidebar sidebar-cyan\">\n  <div class=\"navigation\">\n    <div class=\"logo\">\n  \n    \n  <a href=\"https://github.com/billthefarmer/editor\" target=\"_blank\" >\n    <img src=\"images/icon.png\" style=\"max-width: 25%\" />\n  </a>\n    \n  <a href=\"https://f-droid.org/packages/org.billthefarmer.editor\" target=\"_blank\" >\n    <img src=\"https://fdroid.gitlab.io/artwork/badge/get-it-on.svg\" style=\"max-width: 40%\" />\n  </a>\n    \n  <a href=\"https://github.com/billthefarmer/editor/releases\" target=\"_blank\" >\n    <img src=\"https://img.shields.io/github/v/release/billthefarmer/editor.svg?logo=github\" />\n  </a>\n    \n  \n</div>\n\n    <h1 class=\"site-title\"><a href=\"https://billthefarmer.github.io/editor/\">Editor</a></h1>\n\n\n    <nav class=\"internal\">\n      <ul>\n    \n        \n            \n    <li>\n        <a href=\"#introduction\">Introduction</a>\n        <ul>\n            \n                \n                    <li><a href=\"#features\">Features</a></li>\n                \n            \n        </ul>\n    </li>\n\n\n\n        \n            \n    <li>\n        <a href=\"#using\">Using</a>\n        <ul>\n            \n                \n                    <li><a href=\"#toolbar\">Toolbar</a></li>\n                \n                    <li><a href=\"#open\">Open</a></li>\n                \n                    <li><a href=\"#open-recent\">Open Recent</a></li>\n                \n                    <li><a href=\"#save-as\">Save As</a></li>\n                \n                    <li><a href=\"#search\">Search</a></li>\n                \n                    <li><a href=\"#findall\">Findall</a></li>\n                \n                    <li><a href=\"#goto\">Go to</a></li>\n                \n                    <li><a href=\"#print\">Print</a></li>\n                \n                    <li><a href=\"#view-markdown\">View Markdown</a></li>\n                \n                    <li><a href=\"#charset\">Character set</a></li>\n                \n                    <li><a href=\"#typeface\">Typeface</a></li>\n                \n                    <li><a href=\"#regular-expressions\">Regular Expressions</a></li>\n                \n                    <li><a href=\"#shortcuts\">Shortcuts</a></li>\n                \n                    <li><a href=\"#highlight-syntax\">Highlight Syntax</a></li>\n                \n                    <li><a href=\"#mode-line\">Mode Line</a></li>\n                \n                    <li><a href=\"#word-count\">Word Count</a></li>\n                \n                    <li><a href=\"#extended-selection\">Extended Selection</a></li>\n                \n                    <li><a href=\"#text-size\">Text Size</a></li>\n                \n                    <li><a href=\"#unsaved-file\">Unsaved File</a></li>\n                \n                    <li><a href=\"#changed-file\">Changed File</a></li>\n                \n                    <li><a href=\"#default-file\">Default File</a></li>\n                \n                    <li><a href=\"#shared-file\">Shared File</a></li>\n                \n                    <li><a href=\"#keyboard-shortcuts\">Keyboard Shortcuts</a></li>\n                \n            \n        </ul>\n    </li>\n\n\n\n        \n    \n</ul>\n\n    </nav>\n\n    <nav class=\"external\">\n      <div class=\"external-title\"></div>\n      \n    </nav>\n  </div>\n\n  <div class=\"version\">\n    <p id=\"version\">\n  Copyright &copy; 2026 Bill Farmer\n</p>\n\n  </div>\n</div>\n\n<div class=\"content\">\n    \n        \n            \n    <section class=\"page\" id=\"introduction\">\n    \n    <h1>\n        <a href=\"#introduction\">Introduction</a>\n    </h1>\n    \n    <div class=\"content\">\n        <p>Android simple generic text editor.</p>\n<p><img src=\"images/Editor.png\" alt=\"Editor\"> <img src=\"images/Editor-chooser.png\" alt=\"Chooser\"></p>\n<p>This is a very simple generic text editor which may be used standalone\nor to show or edit any sort of text file from another app. If you\nselect a text file in a file manager or similar app you will be\noffered the option of using this editor along with whatever other apps\nyou have installed that can show or edit a text file. Files will\ninitially be opened read only, long touch on the display or touch the\nedit item in the toolbar to enable editing.</p>\n\n    </div>\n</section>\n\n    \n            \n                <section class=\"page\" id=\"features\">\n    \n    <h3>\n        <a href=\"#features\">Features</a>\n    </h3>\n    \n    <div class=\"content\">\n        <ul>\n<li>File chooser</li>\n<li>Default file</li>\n<li>View markdown in browser or html viewer</li>\n<li>Regular expression text search</li>\n<li>Character set detection and selection</li>\n<li>Optional syntax highlighting</li>\n<li>Open recent files from menu</li>\n<li>Optionally view files</li>\n<li>Optional auto save</li>\n<li>Optional Word wrap</li>\n<li>New file shortcut</li>\n<li>Light/Dark/Black/Retro themes</li>\n<li>Small/Medium/Large font size</li>\n<li>Monospace/Proportional/Sans serif/Serif font faces</li>\n</ul>\n\n    </div>\n</section>\n\n            \n    \n\n\n\n        \n            \n    <section class=\"page\" id=\"using\">\n    \n    <h1>\n        <a href=\"#using\">Using</a>\n    </h1>\n    \n    <div class=\"content\">\n        <p><img src=\"images/Editor-landscape.png\" alt=\"Toolbar\"></p>\n\n    </div>\n</section>\n\n    \n            \n                <section class=\"page\" id=\"toolbar\">\n    \n    <h3>\n        <a href=\"#toolbar\">Toolbar</a>\n    </h3>\n    \n    <div class=\"content\">\n        <p>There are five toolbar items which may appear:</p>\n<ul>\n<li><strong>Edit</strong> – Edit the current read only file</li>\n<li><strong>View</strong> – View the current file read only</li>\n<li><strong>Save</strong> – Save the current file if modified</li>\n<li><strong>New</strong> – Start a new empty file</li>\n<li><strong>Open</strong> – Open a text file using a chooser</li>\n</ul>\n<p>And on the menu:</p>\n<ul>\n<li><strong>Open recent</strong> – Pop up a list of recent files\n<ul>\n<li><strong>Clear list</strong> – Clear list of recent files</li>\n</ul>\n</li>\n<li><strong>Search</strong> – Interactive search of text using a regular\nexpression</li>\n<li><strong>Find all</strong> – Find all recent files containing search text</li>\n<li><strong>Save as</strong> – Save the current file with a new name</li>\n<li><strong>Go to</strong> – Scroll to selected position in file</li>\n<li><strong>View markdown</strong> – View markdown in browser or html viewer</li>\n<li><strong>Charset</strong> – Select character set, shows current set</li>\n<li><strong>Options</strong> – Select options\n<ul>\n<li><strong>View files</strong> – Open files read only for viewing</li>\n<li><strong>Open last</strong> – Open last opened file on startup</li>\n<li><strong>Auto save</strong> – Save the current file on app pause</li>\n<li><strong>Word wrap</strong> – Limit text width to screen width and word wrap</li>\n<li><strong>Suggestions</strong> – Text input and spelling suggestions</li>\n<li><strong>Highlight syntax</strong> – Highlight programming language syntax</li>\n</ul>\n</li>\n<li><strong>Theme</strong> – Choose theme\n<ul>\n<li><strong>Light</strong></li>\n<li><strong>Dark</strong></li>\n<li><strong>System</strong></li>\n<li><strong>White</strong></li>\n<li><strong>Black</strong></li>\n<li><strong>Retro</strong></li>\n</ul>\n</li>\n<li><strong>Text size</strong> – Choose text size\n<ul>\n<li><strong>Small</strong></li>\n<li><strong>Medium</strong></li>\n<li><strong>Large</strong></li>\n</ul>\n</li>\n<li><strong>Typeface</strong> – Choose typeface\n<ul>\n<li><strong>Monospace</strong></li>\n<li><strong>Proportional</strong></li>\n</ul>\n</li>\n<li><strong>About</strong> – Show version, copyright and licence</li>\n</ul>\n\n    </div>\n</section>\n\n            \n                <section class=\"page\" id=\"open\">\n    \n    <h3>\n        <a href=\"#open\">Open</a>\n    </h3>\n    \n    <div class=\"content\">\n        <p>Choose a file to open from the chooser dialog that pops up. The file\nwill initially be read-only. Touch the Edit toolbar item to enable\nediting.</p>\n<p>The chooser shows a scrollable row of folder buttons and list of files\nwith icons. Files which appear to be media files, or are too large\nwill be disabled and not selectable. Touch a folder button or a folder\nto change folder, or a file to open a file. Hidden files beginning\nwith a &lsquo;.&rsquo; will not appear.</p>\n<p>The parent folder, if it exists, will appear first in the list. Touch\nthat folder to move up the directory tree. If a folder is not\naccessible, the chooser will show the parent folder, if it exists, and\nthe external storage folder (<code>/storage/emulated/0</code>).</p>\n<p>Use the <strong>Storage</strong> button to open files using the android file\nmanager. This should ensure that files on removeable SD cards can be\nsaved using the <strong>Save</strong> button. The file manager may refuse to open\nsome types of text files not recognised by android.</p>\n\n    </div>\n</section>\n\n            \n                <section class=\"page\" id=\"open-recent\">\n    \n    <h3>\n        <a href=\"#open-recent\">Open Recent</a>\n    </h3>\n    \n    <div class=\"content\">\n        <p>Choose a file from the list that pops up. As above the file will\ninitially be read only. The last entry, <strong>Clear list</strong>, will clear the\nlist.</p>\n\n    </div>\n</section>\n\n            \n                <section class=\"page\" id=\"save-as\">\n    \n    <h3>\n        <a href=\"#save-as\">Save As</a>\n    </h3>\n    \n    <div class=\"content\">\n        <p>Enter a new file name in the dialog that pops up. Absolute names\nstarting with a slash &lsquo;/&rsquo; will be saved in that exact path. Names\nwithout a starting slash will be saved relative to the main public\nfolder, <code>/sdcard/</code>, or <code>/storage/emulated/0/</code>. Touch the <strong>Storage</strong>\nbutton to use the android file manager to save the file.</p>\n\n    </div>\n</section>\n\n            \n                <section class=\"page\" id=\"search\">\n    \n    <h3>\n        <a href=\"#search\">Search</a>\n    </h3>\n    \n    <div class=\"content\">\n        <p><img src=\"images/Editor-search.png\" alt=\"Search\"></p>\n<p>Enter search text in the field that pops up in the toolbar. The first\nmatching item will be highlighted. Use the search button in the\nkeyboard for find next. The exact regular expression syntax used is in\nthe android documentation for <a href=\"https://developer.android.com/reference/java/util/regex/Pattern#sum\">Pattern</a>.</p>\n\n    </div>\n</section>\n\n            \n                <section class=\"page\" id=\"findall\">\n    \n    <h3>\n        <a href=\"#findall\">Findall</a>\n    </h3>\n    \n    <div class=\"content\">\n        <p><img src=\"images/Editor-findall.png\" alt=\"FindAll\"></p>\n<p>You may find all recent files that contain the current search\ntext. This menu item will only appear while the search widget is\nactive. A dialog will pop up with a list of matching files. Touch an\nentry to open that file. You may repeat this or refine the search text\nto find the desired file.</p>\n\n    </div>\n</section>\n\n            \n                <section class=\"page\" id=\"goto\">\n    \n    <h3>\n        <a href=\"#goto\">Go to</a>\n    </h3>\n    \n    <div class=\"content\">\n        <p><img src=\"images/Editor-goto.png\" alt=\"Go to\"></p>\n<p>Select position in the current file on the horizontal seek bar in the\ndialog which will pop up.</p>\n\n    </div>\n</section>\n\n            \n                <section class=\"page\" id=\"print\">\n    \n    <h3>\n        <a href=\"#print\">Print</a>\n    </h3>\n    \n    <div class=\"content\">\n        <p><img src=\"images/Editor-print.png\" alt=\"Print\"></p>\n<p>Print the current file. If you would like the output highlighted, you\nwill need to scroll slowly through the whole file to give the app a\nchance to highlight it. <strong>Caution</strong> – Attempting to print a\nlarge file on an older device with limited resources may cause the app\nto stop responding.</p>\n\n    </div>\n</section>\n\n            \n                <section class=\"page\" id=\"view-markdown\">\n    \n    <h3>\n        <a href=\"#view-markdown\">View Markdown</a>\n    </h3>\n    \n    <div class=\"content\">\n        <p>You will be prompted to choose a viewer for an html file containing\nthe encoded markdown from the current open file. If the text contains\nno markdown the result will be the same text.</p>\n\n    </div>\n</section>\n\n            \n                <section class=\"page\" id=\"charset\">\n    \n    <h3>\n        <a href=\"#charset\">Character set</a>\n    </h3>\n    \n    <div class=\"content\">\n        <p><img src=\"images/Editor-charset.png\" alt=\"Charset\"></p>\n<p>The current character set is displayed under the current file name. The character set is detected when a new file is read. It may be changed by selecting the Charset item in the menu, which shows the current character set.</p>\n<h4 id=\"default\">Default</h4>\n<p>The default character set is set to UTF-8 on selecting New from the toolbar. It may be changed in the menu. Android defaults to UTF-8, don&rsquo;t use anything else unless you are sure what you are doing.</p>\n<h4 id=\"detection\">Detection</h4>\n<p>The current character set is detected on reading a file by the detection code from International Components for Unicode. If there are no accented characters or symbols in the text to give the detection algorithm something to work on it may not get it right.</p>\n<h4 id=\"saving\">Saving</h4>\n<p>Files will be saved using the current character set. To change it, use the Charset item in the menu, which shows the current set.</p>\n<p>Caution – If you add accented characters or symbols to the text, make sure to check the current character set before you save it.</p>\n<h4 id=\"use-mode-line\">Use mode line</h4>\n<p>The character set may be set to UTF-8 by using a mode line in the text.</p>\n<pre tabindex=\"0\"><code># ed: cs:u\n</code></pre><p>See <a href=\"#mode-line\">Mode Line</a></p>\n\n    </div>\n</section>\n\n            \n                <section class=\"page\" id=\"typeface\">\n    \n    <h3>\n        <a href=\"#typeface\">Typeface</a>\n    </h3>\n    \n    <div class=\"content\">\n        <p><img src=\"images/Editor-typeface.png\" alt=\"Typeface\"></p>\n<p>The <strong>Typeface</strong> menu item shows a choice of common typefaces. These\nare aliases for the fonts commonly provided on android devices. Some\nof them resolve to the same font, depending on the device.</p>\n\n    </div>\n</section>\n\n            \n                <section class=\"page\" id=\"regular-expressions\">\n    \n    <h3>\n        <a href=\"#regular-expressions\">Regular Expressions</a>\n    </h3>\n    \n    <div class=\"content\">\n        <p>Explaining <a href=\"https://en.wikipedia.org/wiki/Regular_expression\">regular expressions</a> used in the text search is beyond\nthe scope of these docs. There is at least one <a href=\"https://www.oreilly.com/library/view/mastering-regular-expressions/0596528124/\">book</a> (of many)\ndevoted to the subject. Use <code>(?i)</code> for case insensitive search, <code>.</code>\nmatches any character once, <code>.?</code> matches any character once or not at\nall, <code>.+</code> matches any character one or more times, <code>.*</code> matches any\ncharacter any times or not at all. Use <code>.+?</code> or <code>.*?</code> for reluctant\nversions. Use <code>\\b</code> for a word boundary, <code>\\d</code> for a digit, <code>\\s</code> for a\nwhite space character, <code>\\w</code> for a word character, so <code>\\w+</code> matches\nwords. Use <code>[abc]</code> to match a set of characters, or <code>[a-z]</code> for a\nrange, so <code>\\w*[aeiou]+\\w*</code> should match any word with at least one\nvowel in it.</p>\n\n    </div>\n</section>\n\n            \n                <section class=\"page\" id=\"shortcuts\">\n    \n    <h3>\n        <a href=\"#shortcuts\">Shortcuts</a>\n    </h3>\n    \n    <div class=\"content\">\n        <p><img src=\"images/Editor-widgets.png\" alt=\"Shortcut\"> <img src=\"images/Editor-shortcut.png\" alt=\"Shortcut\"></p>\n<p><img src=\"images/Editor-open.png\" alt=\"Shortcut\"> <img src=\"images/Editor-name.png\" alt=\"Shortcut\"></p>\n<p>You may create a <strong>New file</strong> or an <strong>Open file</strong> shortcut in the\nlauncher. The <strong>New file</strong> widget will create an shortcut to open a\nnew file in Editor. The <strong>Open file</strong> widget will pop up a dialog\nshowing the file chooser. You may choose a file or use the <strong>Storage</strong>\nbutton. You may cancel and fill in the name and path fields, or edit\nthe name or path fields after choosing a file. Use the <strong>Create</strong>\nbutton to create the shortcut. <strong>Note</strong> – content URIs returned\nby the android file picker will not be resolved.</p>\n\n    </div>\n</section>\n\n            \n                <section class=\"page\" id=\"highlight-syntax\">\n    \n    <h3>\n        <a href=\"#highlight-syntax\">Highlight Syntax</a>\n    </h3>\n    \n    <div class=\"content\">\n        <p><img src=\"images/Editor-syntax.png\" alt=\"Syntax\"></p>\n<p>If the current open file is a C, C++, Objective C, Dart, Go, Java,\nJavascript, Python, Rust, Shell script, Swift, CSS, HTML, <a href=\"https://orgmode.org\" title=\"https://orgmode.org\">Emacs\nOrg</a> or Markdown file, the keywords, classes comments, strings, etc\nwill be highlighted.</p>\n<h3 id=\"selection\">Selection</h3>\n<p>The type of highlighting is selected by file extension. Files with\n<code>.c</code>, <code>.cc</code>, <code>.c++</code>, <code>.cxx</code>, <code>.m</code>, <code>.h</code>, <code>.dart</code>, <code>.go</code>, <code>.js</code>,\n<code>.java</code>, <code>.py</code>, <code>.rs</code>, <code>.sh</code>, <code>.swift</code> extensions will be highlighted\nwith &lsquo;C&rsquo; style highlighting. Files with <code>.htm</code>, <code>.html</code> extensions\nwill be highlighted as HTML. Files with <code>.cs</code>, <code>.css</code> extensions will\nbe highlighted as CSS. Files with <code>.md</code> extensions will be highlighted\nas markdown. Files with <code>.org</code> extensions will be highlighted as Emacs\nOrg.</p>\n<h3 id=\"parsing\">Parsing</h3>\n<p>The algorithm makes no attempt at parsing. The text is scanned for\nrelevent keywords, classes, constants, strings and comments and\nhighlighted accordingly. Therefore it will not be exactly correct, but\ngood enough for a simple text editor. See <a href=\"https://billthefarmer.github.io/blog/post/source-code-highlighting\" title=\"https://billthefarmer.github.io/blog/post/source-code-highlighting\">Source Code Syntax\nHighlighting</a>.</p>\n<h4 id=\"c-type\">C type</h4>\n<p>Keywords and types are matched from lists of C/C++/Objective\nC/Go/Java/Javascript/Python/Shell/Swift keywords and types. Classes\nare capitalised words. Constants are all caps words. Strings are in\ndouble quotes. Single quotes are ignored because apostrophes break the\nalgorithm. Both <code>/* */</code> and <code>// </code> C style comments and <code># </code> Shell\nscript style comments are recognised.</p>\n<h4 id=\"html\">HTML</h4>\n<p>HTML keywords are matched from a list. Double quoted arguments are\nhighlighted. As above, single quotes are ignored. HTML comments <code>&lt;!-- --&gt;</code> are recognised.</p>\n<h4 id=\"css\">CSS</h4>\n<p>CSS style names are matched from a list. Double quoted arguments are\nhighlighted. As above, single quotes are ignored. C style comments are\nrecognised.</p>\n<h4 id=\"markdown\">Markdown</h4>\n<p>Markdown headers, links, emphasis and code will be highlighted.</p>\n<h4 id=\"emacs-org\">Emacs Org</h4>\n<p>Metadata, headers, links, emphasis and inline code will be highlighted.</p>\n<h4 id=\"default\">Default</h4>\n<p>Files with unrecognised extensions which are not plain text files will\nbe highlighted with default highlighting, similar to C type\nhighlighting. Comments will not be highlighted as there is little\nconsistency with comment delimiters outside C type languages.</p>\n<p><strong>Caution</strong> Files with strings of symbols may defeat the\nregex processing and cause the app to stop responding.</p>\n<h4 id=\"limitations\">Limitations</h4>\n<p>Because scanning and highlighting a large file can be quite slow,\nmaking the app unresponsive, only the text currently in view is\nscanned and highlighted. Therefore as the text is edited or scrolled,\nthe new region in view will be scanned and highlighted after a short\ndelay to allow for user typing without the highlighting running\nconstantly.</p>\n<h4 id=\"scrolling\">Scrolling</h4>\n<p>After the text is highlighted, the android view system will re-layout\nthe views whether they need it or not. That causes the current cursor\nposition to be scrolled back into view, which can be extremely\nannoying. So the cursor is moved if necessary to keep it within the\nvisible region.</p>\n<h4 id=\"horizontal-scrolling\">Horizontal scrolling</h4>\n<p>On devices running android versions less than Marshmallow M (6),\nhorizontal scrolling will scroll back again. Make the text size\nsmaller or rotate the device to avoid this. Or turn the highlighting\noff.</p>\n\n    </div>\n</section>\n\n            \n                <section class=\"page\" id=\"mode-line\">\n    \n    <h3>\n        <a href=\"#mode-line\">Mode Line</a>\n    </h3>\n    \n    <div class=\"content\">\n        <p>If a line of text is found within the first or last two or three lines\nof the file which matches the mode line pattern, the mode of the\neditor will be changed after the file is loaded.  The pattern is one\nor more text or punctuation characters, white space, the text <code>ed:</code>\nfollowed by one or more option patterns separated by white space.</p>\n<pre><code># ed: [[no]vw] [[no]ww] [[no]sg] [[no]hs] [cs:u] [th:l|d|s|w|b|r] [ts:l|m|s] [tf:m|p|s]\n</code></pre>\n<p>The initial text or punctuation characters are intended to be used to\nhide the mode line from compilers and interpreters by commenting it\nout.</p>\n<p>The option patterns are:</p>\n<ul>\n<li><strong>[no]vw</strong> – View files read only</li>\n<li><strong>[no]ww</strong> – Word wrap</li>\n<li><strong>[no]sg</strong> – Suggestions</li>\n<li><strong>[no]hs</strong> – Syntax highlighting</li>\n<li><strong>cs:u</strong> – Character set – UTF-8</li>\n<li><strong>th:l|d|s|w|b|r</strong> – Theme – light, dark, system,\nwhite, black or retro</li>\n<li><strong>ts:l|m|s</strong> – Text size – large, medium or small</li>\n<li><strong>tf:m|p|s</strong> – Typeface – monospace, proportional\n(sans) or serif</li>\n</ul>\n<p>The mode line is read after the file is loaded and will change\nimmediately, except in Android 6, Marshmallow due to an obscure\nbug. Rotate the device to change mode.</p>\n\n    </div>\n</section>\n\n            \n                <section class=\"page\" id=\"word-count\">\n    \n    <h3>\n        <a href=\"#word-count\">Word Count</a>\n    </h3>\n    \n    <div class=\"content\">\n        <p>The file word count and character count are shown in the toolbar. Due\nto the algorithm used, the result may differ from that produced by\nother utilities.</p>\n\n    </div>\n</section>\n\n            \n                <section class=\"page\" id=\"extended-selection\">\n    \n    <h3>\n        <a href=\"#extended-selection\">Extended Selection</a>\n    </h3>\n    \n    <div class=\"content\">\n        <p>If the file being edited is not a plain text file, selections created\nby double tapping or long touching on the text will be extended to\nenclosing delimiters (brackets, quotes) on the same text line.</p>\n\n    </div>\n</section>\n\n            \n                <section class=\"page\" id=\"text-size\">\n    \n    <h3>\n        <a href=\"#text-size\">Text Size</a>\n    </h3>\n    \n    <div class=\"content\">\n        <p>Text size may be changed from the menu or by pinch or expand gestures on the text or by doubletap and swipe. The response to gestures on large files may be slow or delayed.</p>\n\n    </div>\n</section>\n\n            \n                <section class=\"page\" id=\"unsaved-file\">\n    \n    <h3>\n        <a href=\"#unsaved-file\">Unsaved File</a>\n    </h3>\n    \n    <div class=\"content\">\n        <p>If you touch the new, back or open button, and the current file has\nbeen modified, you will be prompted whether you want to save it, else\nthe editor will just exit or open a file chooser. The current file may\nbe saved on app pause using the menu option. The scroll position and\nname will be remembered for the last 10 files opened.</p>\n\n    </div>\n</section>\n\n            \n                <section class=\"page\" id=\"changed-file\">\n    \n    <h3>\n        <a href=\"#changed-file\">Changed File</a>\n    </h3>\n    \n    <div class=\"content\">\n        <p>If a file has changed in storage while it was open in the editor, if\nyou attempt to save it, or the app is resumed, you will be prompted\nwhether to overwrite or reload the file.</p>\n\n    </div>\n</section>\n\n            \n                <section class=\"page\" id=\"default-file\">\n    \n    <h3>\n        <a href=\"#default-file\">Default File</a>\n    </h3>\n    \n    <div class=\"content\">\n        <p>If there is no open file any text entered will by default be saved in\n<code>Documents/Editor.txt</code>. This file will be loaded on start if it\nexists. Use the <strong>Save as</strong> menu item to save it elsewhere.</p>\n\n    </div>\n</section>\n\n            \n                <section class=\"page\" id=\"shared-file\">\n    \n    <h3>\n        <a href=\"#shared-file\">Shared File</a>\n    </h3>\n    \n    <div class=\"content\">\n        <p>Text files opened or shared by another app may be viewed and\nedited. Some apps may share files or text using a <code>content</code> URI that\nis not resolvable to a path to a file in storage. In that case the\neditor will read the file into a new file. The <strong>Save</strong> item will save\nthe file in the original location if possible.</p>\n<p><strong>Note</strong> – Apps that share files will usually only give another\napp read permission. Use the <strong>Save as</strong> menu item to save the file\nelsewhere.</p>\n\n    </div>\n</section>\n\n            \n                <section class=\"page\" id=\"keyboard-shortcuts\">\n    \n    <h3>\n        <a href=\"#keyboard-shortcuts\">Keyboard Shortcuts</a>\n    </h3>\n    \n    <div class=\"content\">\n        <p>When using an external keyboard, some keyboard shortcuts are\nimplemented:</p>\n<ul>\n<li>Ctrl+E – Edit mode</li>\n<li>Ctrl+Shift+E – View mode</li>\n<li>Ctrl+F – Search</li>\n<li>Ctrl+Shift+F – Close search</li>\n<li>Ctrl+Alt+F – Find next</li>\n<li>Ctrl+G – Go to</li>\n<li>Ctrl+M – Show menu</li>\n<li>Ctrl+N – New file</li>\n<li>Ctrl+O – Open file</li>\n<li>Ctrl+S – Save file</li>\n<li>Ctrl+Shift+S – Save as</li>\n<li>Ctrl++ – Increase text size</li>\n<li>Ctrl+- – Decrease text size</li>\n<li>F3 – Find next</li>\n<li>F10 – Show menu</li>\n</ul>\n<p>Many other shortcuts – Ctrl+A, Ctrl+C, Ctrl+V, Ctrl+X, Ctrl+Z\nare already build in to android.</p>\n\n    </div>\n</section>\n\n            \n    \n\n\n\n        \n    \n</div>\n</body>\n</html>\n\n"
  },
  {
    "path": "docs/index.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>\n<rss version=\"2.0\" xmlns:atom=\"http://www.w3.org/2005/Atom\">\n  <channel>\n    <title>Editor</title>\n    <link>https://billthefarmer.github.io/editor/</link>\n    <description>Recent content on Editor</description>\n    <generator>Hugo</generator>\n    <language>en-gb</language>\n    <copyright>Copyright &amp;copy; 2006 Bill Farmer</copyright>\n    <lastBuildDate>Sun, 18 Feb 2024 10:54:01 +0000</lastBuildDate>\n    <atom:link href=\"https://billthefarmer.github.io/editor/index.xml\" rel=\"self\" type=\"application/rss+xml\" />\n    <item>\n      <title>Features</title>\n      <link>https://billthefarmer.github.io/editor/introduction/features/</link>\n      <pubDate>Wed, 04 Mar 2020 15:40:25 +0000</pubDate>\n      <guid>https://billthefarmer.github.io/editor/introduction/features/</guid>\n      <description>&lt;ul&gt;&#xA;&lt;li&gt;File chooser&lt;/li&gt;&#xA;&lt;li&gt;Default file&lt;/li&gt;&#xA;&lt;li&gt;View markdown in browser or html viewer&lt;/li&gt;&#xA;&lt;li&gt;Regular expression text search&lt;/li&gt;&#xA;&lt;li&gt;Character set detection and selection&lt;/li&gt;&#xA;&lt;li&gt;Optional syntax highlighting&lt;/li&gt;&#xA;&lt;li&gt;Open recent files from menu&lt;/li&gt;&#xA;&lt;li&gt;Optionally view files&lt;/li&gt;&#xA;&lt;li&gt;Optional auto save&lt;/li&gt;&#xA;&lt;li&gt;Optional Word wrap&lt;/li&gt;&#xA;&lt;li&gt;New file shortcut&lt;/li&gt;&#xA;&lt;li&gt;Light/Dark/Black/Retro themes&lt;/li&gt;&#xA;&lt;li&gt;Small/Medium/Large font size&lt;/li&gt;&#xA;&lt;li&gt;Monospace/Proportional/Sans serif/Serif font faces&lt;/li&gt;&#xA;&lt;/ul&gt;</description>\n    </item>\n    <item>\n      <title>Toolbar</title>\n      <link>https://billthefarmer.github.io/editor/using/toolbar/</link>\n      <pubDate>Wed, 04 Mar 2020 16:06:10 +0000</pubDate>\n      <guid>https://billthefarmer.github.io/editor/using/toolbar/</guid>\n      <description>&lt;p&gt;There are five toolbar items which may appear:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Edit&lt;/strong&gt; – Edit the current read only file&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;View&lt;/strong&gt; – View the current file read only&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Save&lt;/strong&gt; – Save the current file if modified&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;New&lt;/strong&gt; – Start a new empty file&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Open&lt;/strong&gt; – Open a text file using a chooser&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;And on the menu:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Open recent&lt;/strong&gt; – Pop up a list of recent files&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Clear list&lt;/strong&gt; – Clear list of recent files&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Search&lt;/strong&gt; – Interactive search of text using a regular&#xA;expression&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Find all&lt;/strong&gt; – Find all recent files containing search text&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Save as&lt;/strong&gt; – Save the current file with a new name&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Go to&lt;/strong&gt; – Scroll to selected position in file&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;View markdown&lt;/strong&gt; – View markdown in browser or html viewer&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Charset&lt;/strong&gt; – Select character set, shows current set&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Options&lt;/strong&gt; – Select options&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;View files&lt;/strong&gt; – Open files read only for viewing&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Open last&lt;/strong&gt; – Open last opened file on startup&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Auto save&lt;/strong&gt; – Save the current file on app pause&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Word wrap&lt;/strong&gt; – Limit text width to screen width and word wrap&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Suggestions&lt;/strong&gt; – Text input and spelling suggestions&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Highlight syntax&lt;/strong&gt; – Highlight programming language syntax&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Theme&lt;/strong&gt; – Choose theme&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Light&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Dark&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;System&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;White&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Black&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Retro&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Text size&lt;/strong&gt; – Choose text size&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Small&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Medium&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Large&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Typeface&lt;/strong&gt; – Choose typeface&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Monospace&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Proportional&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;About&lt;/strong&gt; – Show version, copyright and licence&lt;/li&gt;&#xA;&lt;/ul&gt;</description>\n    </item>\n    <item>\n      <title>Open</title>\n      <link>https://billthefarmer.github.io/editor/using/open/</link>\n      <pubDate>Wed, 04 Mar 2020 19:32:49 +0000</pubDate>\n      <guid>https://billthefarmer.github.io/editor/using/open/</guid>\n      <description>&lt;p&gt;Choose a file to open from the chooser dialog that pops up. The file&#xA;will initially be read-only. Touch the Edit toolbar item to enable&#xA;editing.&lt;/p&gt;&#xA;&lt;p&gt;The chooser shows a scrollable row of folder buttons and list of files&#xA;with icons. Files which appear to be media files, or are too large&#xA;will be disabled and not selectable. Touch a folder button or a folder&#xA;to change folder, or a file to open a file. Hidden files beginning&#xA;with a &amp;lsquo;.&amp;rsquo; will not appear.&lt;/p&gt;</description>\n    </item>\n    <item>\n      <title>Open Recent</title>\n      <link>https://billthefarmer.github.io/editor/using/open-recent/</link>\n      <pubDate>Wed, 04 Mar 2020 19:32:37 +0000</pubDate>\n      <guid>https://billthefarmer.github.io/editor/using/open-recent/</guid>\n      <description>&lt;p&gt;Choose a file from the list that pops up. As above the file will&#xA;initially be read only. The last entry, &lt;strong&gt;Clear list&lt;/strong&gt;, will clear the&#xA;list.&lt;/p&gt;</description>\n    </item>\n    <item>\n      <title>Save As</title>\n      <link>https://billthefarmer.github.io/editor/using/save-as/</link>\n      <pubDate>Wed, 04 Mar 2020 19:33:09 +0000</pubDate>\n      <guid>https://billthefarmer.github.io/editor/using/save-as/</guid>\n      <description>&lt;p&gt;Enter a new file name in the dialog that pops up. Absolute names&#xA;starting with a slash &amp;lsquo;/&amp;rsquo; will be saved in that exact path. Names&#xA;without a starting slash will be saved relative to the main public&#xA;folder, &lt;code&gt;/sdcard/&lt;/code&gt;, or &lt;code&gt;/storage/emulated/0/&lt;/code&gt;. Touch the &lt;strong&gt;Storage&lt;/strong&gt;&#xA;button to use the android file manager to save the file.&lt;/p&gt;</description>\n    </item>\n    <item>\n      <title>Search</title>\n      <link>https://billthefarmer.github.io/editor/using/search/</link>\n      <pubDate>Wed, 04 Mar 2020 19:38:08 +0000</pubDate>\n      <guid>https://billthefarmer.github.io/editor/using/search/</guid>\n      <description>&lt;p&gt;&lt;img src=&#34;images/Editor-search.png&#34; alt=&#34;Search&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;Enter search text in the field that pops up in the toolbar. The first&#xA;matching item will be highlighted. Use the search button in the&#xA;keyboard for find next. The exact regular expression syntax used is in&#xA;the android documentation for &lt;a href=&#34;https://developer.android.com/reference/java/util/regex/Pattern#sum&#34;&gt;Pattern&lt;/a&gt;.&lt;/p&gt;</description>\n    </item>\n    <item>\n      <title>Findall</title>\n      <link>https://billthefarmer.github.io/editor/using/findall/</link>\n      <pubDate>Thu, 26 Mar 2020 09:56:27 +0000</pubDate>\n      <guid>https://billthefarmer.github.io/editor/using/findall/</guid>\n      <description>&lt;p&gt;&lt;img src=&#34;images/Editor-findall.png&#34; alt=&#34;FindAll&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;You may find all recent files that contain the current search&#xA;text. This menu item will only appear while the search widget is&#xA;active. A dialog will pop up with a list of matching files. Touch an&#xA;entry to open that file. You may repeat this or refine the search text&#xA;to find the desired file.&lt;/p&gt;</description>\n    </item>\n    <item>\n      <title>Go to</title>\n      <link>https://billthefarmer.github.io/editor/using/goto/</link>\n      <pubDate>Thu, 17 Nov 2022 09:49:16 +0000</pubDate>\n      <guid>https://billthefarmer.github.io/editor/using/goto/</guid>\n      <description>&lt;p&gt;&lt;img src=&#34;images/Editor-goto.png&#34; alt=&#34;Go to&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;Select position in the current file on the horizontal seek bar in the&#xA;dialog which will pop up.&lt;/p&gt;</description>\n    </item>\n    <item>\n      <title>Print</title>\n      <link>https://billthefarmer.github.io/editor/using/print/</link>\n      <pubDate>Sat, 26 Nov 2022 09:54:15 +0000</pubDate>\n      <guid>https://billthefarmer.github.io/editor/using/print/</guid>\n      <description>&lt;p&gt;&lt;img src=&#34;images/Editor-print.png&#34; alt=&#34;Print&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;Print the current file. If you would like the output highlighted, you&#xA;will need to scroll slowly through the whole file to give the app a&#xA;chance to highlight it. &lt;strong&gt;Caution&lt;/strong&gt; – Attempting to print a&#xA;large file on an older device with limited resources may cause the app&#xA;to stop responding.&lt;/p&gt;</description>\n    </item>\n    <item>\n      <title>View Markdown</title>\n      <link>https://billthefarmer.github.io/editor/using/view-markdown/</link>\n      <pubDate>Wed, 04 Mar 2020 19:40:02 +0000</pubDate>\n      <guid>https://billthefarmer.github.io/editor/using/view-markdown/</guid>\n      <description>&lt;p&gt;You will be prompted to choose a viewer for an html file containing&#xA;the encoded markdown from the current open file. If the text contains&#xA;no markdown the result will be the same text.&lt;/p&gt;</description>\n    </item>\n    <item>\n      <title>Character set</title>\n      <link>https://billthefarmer.github.io/editor/using/charset/</link>\n      <pubDate>Wed, 03 Nov 2021 21:12:12 +0000</pubDate>\n      <guid>https://billthefarmer.github.io/editor/using/charset/</guid>\n      <description>&lt;p&gt;&lt;img src=&#34;images/Editor-charset.png&#34; alt=&#34;Charset&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;The current character set is displayed under the current file name. The character set is detected when a new file is read. It may be changed by selecting the Charset item in the menu, which shows the current character set.&lt;/p&gt;&#xA;&lt;h4 id=&#34;default&#34;&gt;Default&lt;/h4&gt;&#xA;&lt;p&gt;The default character set is set to UTF-8 on selecting New from the toolbar. It may be changed in the menu. Android defaults to UTF-8, don&amp;rsquo;t use anything else unless you are sure what you are doing.&lt;/p&gt;</description>\n    </item>\n    <item>\n      <title>Typeface</title>\n      <link>https://billthefarmer.github.io/editor/using/typeface/</link>\n      <pubDate>Sun, 18 Feb 2024 10:54:01 +0000</pubDate>\n      <guid>https://billthefarmer.github.io/editor/using/typeface/</guid>\n      <description>&lt;p&gt;&lt;img src=&#34;images/Editor-typeface.png&#34; alt=&#34;Typeface&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;The &lt;strong&gt;Typeface&lt;/strong&gt; menu item shows a choice of common typefaces. These&#xA;are aliases for the fonts commonly provided on android devices. Some&#xA;of them resolve to the same font, depending on the device.&lt;/p&gt;</description>\n    </item>\n    <item>\n      <title>Regular Expressions</title>\n      <link>https://billthefarmer.github.io/editor/using/regular-expressions/</link>\n      <pubDate>Sun, 05 Sep 2021 09:48:08 +0100</pubDate>\n      <guid>https://billthefarmer.github.io/editor/using/regular-expressions/</guid>\n      <description>&lt;p&gt;Explaining &lt;a href=&#34;https://en.wikipedia.org/wiki/Regular_expression&#34;&gt;regular expressions&lt;/a&gt; used in the text search is beyond&#xA;the scope of these docs. There is at least one &lt;a href=&#34;https://www.oreilly.com/library/view/mastering-regular-expressions/0596528124/&#34;&gt;book&lt;/a&gt; (of many)&#xA;devoted to the subject. Use &lt;code&gt;(?i)&lt;/code&gt; for case insensitive search, &lt;code&gt;.&lt;/code&gt;&#xA;matches any character once, &lt;code&gt;.?&lt;/code&gt; matches any character once or not at&#xA;all, &lt;code&gt;.+&lt;/code&gt; matches any character one or more times, &lt;code&gt;.*&lt;/code&gt; matches any&#xA;character any times or not at all. Use &lt;code&gt;.+?&lt;/code&gt; or &lt;code&gt;.*?&lt;/code&gt; for reluctant&#xA;versions. Use &lt;code&gt;\\b&lt;/code&gt; for a word boundary, &lt;code&gt;\\d&lt;/code&gt; for a digit, &lt;code&gt;\\s&lt;/code&gt; for a&#xA;white space character, &lt;code&gt;\\w&lt;/code&gt; for a word character, so &lt;code&gt;\\w+&lt;/code&gt; matches&#xA;words. Use &lt;code&gt;[abc]&lt;/code&gt; to match a set of characters, or &lt;code&gt;[a-z]&lt;/code&gt; for a&#xA;range, so &lt;code&gt;\\w*[aeiou]+\\w*&lt;/code&gt; should match any word with at least one&#xA;vowel in it.&lt;/p&gt;</description>\n    </item>\n    <item>\n      <title>Shortcuts</title>\n      <link>https://billthefarmer.github.io/editor/using/shortcut/</link>\n      <pubDate>Wed, 02 Mar 2022 09:34:09 +0000</pubDate>\n      <guid>https://billthefarmer.github.io/editor/using/shortcut/</guid>\n      <description>&lt;p&gt;&lt;img src=&#34;images/Editor-widgets.png&#34; alt=&#34;Shortcut&#34;&gt; &lt;img src=&#34;images/Editor-shortcut.png&#34; alt=&#34;Shortcut&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;images/Editor-open.png&#34; alt=&#34;Shortcut&#34;&gt; &lt;img src=&#34;images/Editor-name.png&#34; alt=&#34;Shortcut&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;You may create a &lt;strong&gt;New file&lt;/strong&gt; or an &lt;strong&gt;Open file&lt;/strong&gt; shortcut in the&#xA;launcher. The &lt;strong&gt;New file&lt;/strong&gt; widget will create an shortcut to open a&#xA;new file in Editor. The &lt;strong&gt;Open file&lt;/strong&gt; widget will pop up a dialog&#xA;showing the file chooser. You may choose a file or use the &lt;strong&gt;Storage&lt;/strong&gt;&#xA;button. You may cancel and fill in the name and path fields, or edit&#xA;the name or path fields after choosing a file. Use the &lt;strong&gt;Create&lt;/strong&gt;&#xA;button to create the shortcut. &lt;strong&gt;Note&lt;/strong&gt; – content URIs returned&#xA;by the android file picker will not be resolved.&lt;/p&gt;</description>\n    </item>\n    <item>\n      <title>Highlight Syntax</title>\n      <link>https://billthefarmer.github.io/editor/using/highlight-syntax/</link>\n      <pubDate>Wed, 04 Mar 2020 19:41:14 +0000</pubDate>\n      <guid>https://billthefarmer.github.io/editor/using/highlight-syntax/</guid>\n      <description>&lt;p&gt;&lt;img src=&#34;images/Editor-syntax.png&#34; alt=&#34;Syntax&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;If the current open file is a C, C++, Objective C, Dart, Go, Java,&#xA;Javascript, Python, Rust, Shell script, Swift, CSS, HTML, &lt;a href=&#34;https://orgmode.org&#34; title=&#34;https://orgmode.org&#34;&gt;Emacs&#xA;Org&lt;/a&gt; or Markdown file, the keywords, classes comments, strings, etc&#xA;will be highlighted.&lt;/p&gt;&#xA;&lt;h3 id=&#34;selection&#34;&gt;Selection&lt;/h3&gt;&#xA;&lt;p&gt;The type of highlighting is selected by file extension. Files with&#xA;&lt;code&gt;.c&lt;/code&gt;, &lt;code&gt;.cc&lt;/code&gt;, &lt;code&gt;.c++&lt;/code&gt;, &lt;code&gt;.cxx&lt;/code&gt;, &lt;code&gt;.m&lt;/code&gt;, &lt;code&gt;.h&lt;/code&gt;, &lt;code&gt;.dart&lt;/code&gt;, &lt;code&gt;.go&lt;/code&gt;, &lt;code&gt;.js&lt;/code&gt;,&#xA;&lt;code&gt;.java&lt;/code&gt;, &lt;code&gt;.py&lt;/code&gt;, &lt;code&gt;.rs&lt;/code&gt;, &lt;code&gt;.sh&lt;/code&gt;, &lt;code&gt;.swift&lt;/code&gt; extensions will be highlighted&#xA;with &amp;lsquo;C&amp;rsquo; style highlighting. Files with &lt;code&gt;.htm&lt;/code&gt;, &lt;code&gt;.html&lt;/code&gt; extensions&#xA;will be highlighted as HTML. Files with &lt;code&gt;.cs&lt;/code&gt;, &lt;code&gt;.css&lt;/code&gt; extensions will&#xA;be highlighted as CSS. Files with &lt;code&gt;.md&lt;/code&gt; extensions will be highlighted&#xA;as markdown. Files with &lt;code&gt;.org&lt;/code&gt; extensions will be highlighted as Emacs&#xA;Org.&lt;/p&gt;</description>\n    </item>\n    <item>\n      <title>Mode Line</title>\n      <link>https://billthefarmer.github.io/editor/using/mode-line/</link>\n      <pubDate>Wed, 04 Mar 2020 17:41:40 +0000</pubDate>\n      <guid>https://billthefarmer.github.io/editor/using/mode-line/</guid>\n      <description>&lt;p&gt;If a line of text is found within the first or last two or three lines&#xA;of the file which matches the mode line pattern, the mode of the&#xA;editor will be changed after the file is loaded.  The pattern is one&#xA;or more text or punctuation characters, white space, the text &lt;code&gt;ed:&lt;/code&gt;&#xA;followed by one or more option patterns separated by white space.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;# ed: [[no]vw] [[no]ww] [[no]sg] [[no]hs] [cs:u] [th:l|d|s|w|b|r] [ts:l|m|s] [tf:m|p|s]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;The initial text or punctuation characters are intended to be used to&#xA;hide the mode line from compilers and interpreters by commenting it&#xA;out.&lt;/p&gt;</description>\n    </item>\n    <item>\n      <title>Word Count</title>\n      <link>https://billthefarmer.github.io/editor/using/word-count/</link>\n      <pubDate>Mon, 29 Mar 2021 18:47:58 +0100</pubDate>\n      <guid>https://billthefarmer.github.io/editor/using/word-count/</guid>\n      <description>&lt;p&gt;The file word count and character count are shown in the toolbar. Due&#xA;to the algorithm used, the result may differ from that produced by&#xA;other utilities.&lt;/p&gt;</description>\n    </item>\n    <item>\n      <title>Extended Selection</title>\n      <link>https://billthefarmer.github.io/editor/using/extended-selection/</link>\n      <pubDate>Wed, 04 Mar 2020 17:42:02 +0000</pubDate>\n      <guid>https://billthefarmer.github.io/editor/using/extended-selection/</guid>\n      <description>&lt;p&gt;If the file being edited is not a plain text file, selections created&#xA;by double tapping or long touching on the text will be extended to&#xA;enclosing delimiters (brackets, quotes) on the same text line.&lt;/p&gt;</description>\n    </item>\n    <item>\n      <title>Text Size</title>\n      <link>https://billthefarmer.github.io/editor/using/text-size/</link>\n      <pubDate>Fri, 16 Jul 2021 09:14:58 +0100</pubDate>\n      <guid>https://billthefarmer.github.io/editor/using/text-size/</guid>\n      <description>&lt;p&gt;Text size may be changed from the menu or by pinch or expand gestures on the text or by doubletap and swipe. The response to gestures on large files may be slow or delayed.&lt;/p&gt;</description>\n    </item>\n    <item>\n      <title>Unsaved File</title>\n      <link>https://billthefarmer.github.io/editor/using/unsaved-file/</link>\n      <pubDate>Wed, 04 Mar 2020 17:42:32 +0000</pubDate>\n      <guid>https://billthefarmer.github.io/editor/using/unsaved-file/</guid>\n      <description>&lt;p&gt;If you touch the new, back or open button, and the current file has&#xA;been modified, you will be prompted whether you want to save it, else&#xA;the editor will just exit or open a file chooser. The current file may&#xA;be saved on app pause using the menu option. The scroll position and&#xA;name will be remembered for the last 10 files opened.&lt;/p&gt;</description>\n    </item>\n    <item>\n      <title>Changed File</title>\n      <link>https://billthefarmer.github.io/editor/using/changed-file/</link>\n      <pubDate>Wed, 04 Mar 2020 17:42:49 +0000</pubDate>\n      <guid>https://billthefarmer.github.io/editor/using/changed-file/</guid>\n      <description>&lt;p&gt;If a file has changed in storage while it was open in the editor, if&#xA;you attempt to save it, or the app is resumed, you will be prompted&#xA;whether to overwrite or reload the file.&lt;/p&gt;</description>\n    </item>\n    <item>\n      <title>Default File</title>\n      <link>https://billthefarmer.github.io/editor/using/default-file/</link>\n      <pubDate>Wed, 04 Mar 2020 17:43:09 +0000</pubDate>\n      <guid>https://billthefarmer.github.io/editor/using/default-file/</guid>\n      <description>&lt;p&gt;If there is no open file any text entered will by default be saved in&#xA;&lt;code&gt;Documents/Editor.txt&lt;/code&gt;. This file will be loaded on start if it&#xA;exists. Use the &lt;strong&gt;Save as&lt;/strong&gt; menu item to save it elsewhere.&lt;/p&gt;</description>\n    </item>\n    <item>\n      <title>Shared File</title>\n      <link>https://billthefarmer.github.io/editor/using/shared-file/</link>\n      <pubDate>Wed, 04 Mar 2020 17:43:39 +0000</pubDate>\n      <guid>https://billthefarmer.github.io/editor/using/shared-file/</guid>\n      <description>&lt;p&gt;Text files opened or shared by another app may be viewed and&#xA;edited. Some apps may share files or text using a &lt;code&gt;content&lt;/code&gt; URI that&#xA;is not resolvable to a path to a file in storage. In that case the&#xA;editor will read the file into a new file. The &lt;strong&gt;Save&lt;/strong&gt; item will save&#xA;the file in the original location if possible.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt; – Apps that share files will usually only give another&#xA;app read permission. Use the &lt;strong&gt;Save as&lt;/strong&gt; menu item to save the file&#xA;elsewhere.&lt;/p&gt;</description>\n    </item>\n    <item>\n      <title>Keyboard Shortcuts</title>\n      <link>https://billthefarmer.github.io/editor/using/keyboard-shortcuts/</link>\n      <pubDate>Wed, 21 Jul 2021 19:22:29 +0100</pubDate>\n      <guid>https://billthefarmer.github.io/editor/using/keyboard-shortcuts/</guid>\n      <description>&lt;p&gt;When using an external keyboard, some keyboard shortcuts are&#xA;implemented:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Ctrl+E – Edit mode&lt;/li&gt;&#xA;&lt;li&gt;Ctrl+Shift+E – View mode&lt;/li&gt;&#xA;&lt;li&gt;Ctrl+F – Search&lt;/li&gt;&#xA;&lt;li&gt;Ctrl+Shift+F – Close search&lt;/li&gt;&#xA;&lt;li&gt;Ctrl+Alt+F – Find next&lt;/li&gt;&#xA;&lt;li&gt;Ctrl+G – Go to&lt;/li&gt;&#xA;&lt;li&gt;Ctrl+M – Show menu&lt;/li&gt;&#xA;&lt;li&gt;Ctrl+N – New file&lt;/li&gt;&#xA;&lt;li&gt;Ctrl+O – Open file&lt;/li&gt;&#xA;&lt;li&gt;Ctrl+S – Save file&lt;/li&gt;&#xA;&lt;li&gt;Ctrl+Shift+S – Save as&lt;/li&gt;&#xA;&lt;li&gt;Ctrl++ – Increase text size&lt;/li&gt;&#xA;&lt;li&gt;Ctrl+- – Decrease text size&lt;/li&gt;&#xA;&lt;li&gt;F3 – Find next&lt;/li&gt;&#xA;&lt;li&gt;F10 – Show menu&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Many other shortcuts – Ctrl+A, Ctrl+C, Ctrl+V, Ctrl+X, Ctrl+Z&#xA;are already build in to android.&lt;/p&gt;</description>\n    </item>\n  </channel>\n</rss>\n"
  },
  {
    "path": "docs/introduction/index.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>\n<rss version=\"2.0\" xmlns:atom=\"http://www.w3.org/2005/Atom\">\n  <channel>\n    <title>Introduction on Editor</title>\n    <link>https://billthefarmer.github.io/editor/introduction/</link>\n    <description>Recent content in Introduction on Editor</description>\n    <generator>Hugo</generator>\n    <language>en-gb</language>\n    <copyright>Copyright &amp;copy; 2006 Bill Farmer</copyright>\n    <lastBuildDate>Wed, 04 Mar 2020 15:40:25 +0000</lastBuildDate>\n    <atom:link href=\"https://billthefarmer.github.io/editor/introduction/index.xml\" rel=\"self\" type=\"application/rss+xml\" />\n    <item>\n      <title>Features</title>\n      <link>https://billthefarmer.github.io/editor/introduction/features/</link>\n      <pubDate>Wed, 04 Mar 2020 15:40:25 +0000</pubDate>\n      <guid>https://billthefarmer.github.io/editor/introduction/features/</guid>\n      <description>&lt;ul&gt;&#xA;&lt;li&gt;File chooser&lt;/li&gt;&#xA;&lt;li&gt;Default file&lt;/li&gt;&#xA;&lt;li&gt;View markdown in browser or html viewer&lt;/li&gt;&#xA;&lt;li&gt;Regular expression text search&lt;/li&gt;&#xA;&lt;li&gt;Character set detection and selection&lt;/li&gt;&#xA;&lt;li&gt;Optional syntax highlighting&lt;/li&gt;&#xA;&lt;li&gt;Open recent files from menu&lt;/li&gt;&#xA;&lt;li&gt;Optionally view files&lt;/li&gt;&#xA;&lt;li&gt;Optional auto save&lt;/li&gt;&#xA;&lt;li&gt;Optional Word wrap&lt;/li&gt;&#xA;&lt;li&gt;New file shortcut&lt;/li&gt;&#xA;&lt;li&gt;Light/Dark/Black/Retro themes&lt;/li&gt;&#xA;&lt;li&gt;Small/Medium/Large font size&lt;/li&gt;&#xA;&lt;li&gt;Monospace/Proportional/Sans serif/Serif font faces&lt;/li&gt;&#xA;&lt;/ul&gt;</description>\n    </item>\n  </channel>\n</rss>\n"
  },
  {
    "path": "docs/sitemap.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>\n<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\"\n  xmlns:xhtml=\"http://www.w3.org/1999/xhtml\">\n  <url>\n    <loc>https://billthefarmer.github.io/editor/introduction/</loc>\n    <lastmod>2020-03-04T15:38:25+00:00</lastmod>\n  </url><url>\n    <loc>https://billthefarmer.github.io/editor/introduction/features/</loc>\n    <lastmod>2020-03-04T15:40:25+00:00</lastmod>\n  </url><url>\n    <loc>https://billthefarmer.github.io/editor/using/</loc>\n    <lastmod>2020-03-04T16:05:59+00:00</lastmod>\n  </url><url>\n    <loc>https://billthefarmer.github.io/editor/using/toolbar/</loc>\n    <lastmod>2020-03-04T16:06:10+00:00</lastmod>\n  </url><url>\n    <loc>https://billthefarmer.github.io/editor/using/open/</loc>\n    <lastmod>2020-03-04T19:32:49+00:00</lastmod>\n  </url><url>\n    <loc>https://billthefarmer.github.io/editor/using/open-recent/</loc>\n    <lastmod>2020-03-04T19:32:37+00:00</lastmod>\n  </url><url>\n    <loc>https://billthefarmer.github.io/editor/using/save-as/</loc>\n    <lastmod>2020-03-04T19:33:09+00:00</lastmod>\n  </url><url>\n    <loc>https://billthefarmer.github.io/editor/using/search/</loc>\n    <lastmod>2020-03-04T19:38:08+00:00</lastmod>\n  </url><url>\n    <loc>https://billthefarmer.github.io/editor/using/findall/</loc>\n    <lastmod>2020-03-26T09:56:27+00:00</lastmod>\n  </url><url>\n    <loc>https://billthefarmer.github.io/editor/using/goto/</loc>\n    <lastmod>2022-11-17T09:49:16+00:00</lastmod>\n  </url><url>\n    <loc>https://billthefarmer.github.io/editor/using/print/</loc>\n    <lastmod>2022-11-26T09:54:15+00:00</lastmod>\n  </url><url>\n    <loc>https://billthefarmer.github.io/editor/using/view-markdown/</loc>\n    <lastmod>2020-03-04T19:40:02+00:00</lastmod>\n  </url><url>\n    <loc>https://billthefarmer.github.io/editor/using/charset/</loc>\n    <lastmod>2021-11-03T21:12:12+00:00</lastmod>\n  </url><url>\n    <loc>https://billthefarmer.github.io/editor/using/typeface/</loc>\n    <lastmod>2024-02-18T10:54:01+00:00</lastmod>\n  </url><url>\n    <loc>https://billthefarmer.github.io/editor/using/regular-expressions/</loc>\n    <lastmod>2021-09-05T09:48:08+01:00</lastmod>\n  </url><url>\n    <loc>https://billthefarmer.github.io/editor/using/shortcut/</loc>\n    <lastmod>2022-03-02T09:34:09+00:00</lastmod>\n  </url><url>\n    <loc>https://billthefarmer.github.io/editor/using/highlight-syntax/</loc>\n    <lastmod>2020-03-04T19:41:14+00:00</lastmod>\n  </url><url>\n    <loc>https://billthefarmer.github.io/editor/using/mode-line/</loc>\n    <lastmod>2020-03-04T17:41:40+00:00</lastmod>\n  </url><url>\n    <loc>https://billthefarmer.github.io/editor/using/word-count/</loc>\n    <lastmod>2021-03-29T18:47:58+01:00</lastmod>\n  </url><url>\n    <loc>https://billthefarmer.github.io/editor/using/extended-selection/</loc>\n    <lastmod>2020-03-04T17:42:02+00:00</lastmod>\n  </url><url>\n    <loc>https://billthefarmer.github.io/editor/using/text-size/</loc>\n    <lastmod>2021-07-16T09:14:58+01:00</lastmod>\n  </url><url>\n    <loc>https://billthefarmer.github.io/editor/using/unsaved-file/</loc>\n    <lastmod>2020-03-04T17:42:32+00:00</lastmod>\n  </url><url>\n    <loc>https://billthefarmer.github.io/editor/using/changed-file/</loc>\n    <lastmod>2020-03-04T17:42:49+00:00</lastmod>\n  </url><url>\n    <loc>https://billthefarmer.github.io/editor/using/default-file/</loc>\n    <lastmod>2020-03-04T17:43:09+00:00</lastmod>\n  </url><url>\n    <loc>https://billthefarmer.github.io/editor/using/shared-file/</loc>\n    <lastmod>2020-03-04T17:43:39+00:00</lastmod>\n  </url><url>\n    <loc>https://billthefarmer.github.io/editor/using/keyboard-shortcuts/</loc>\n    <lastmod>2021-07-21T19:22:29+01:00</lastmod>\n  </url><url>\n    <loc>https://billthefarmer.github.io/editor/</loc>\n    <lastmod>2024-02-18T10:54:01+00:00</lastmod>\n  </url><url>\n    <loc>https://billthefarmer.github.io/editor/categories/</loc>\n  </url><url>\n    <loc>https://billthefarmer.github.io/editor/tags/</loc>\n  </url>\n</urlset>\n"
  },
  {
    "path": "docs/tags/index.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>\n<rss version=\"2.0\" xmlns:atom=\"http://www.w3.org/2005/Atom\">\n  <channel>\n    <title>Tags on Editor</title>\n    <link>https://billthefarmer.github.io/editor/tags/</link>\n    <description>Recent content in Tags on Editor</description>\n    <generator>Hugo</generator>\n    <language>en-gb</language>\n    <copyright>Copyright &amp;copy; 2006 Bill Farmer</copyright>\n    <atom:link href=\"https://billthefarmer.github.io/editor/tags/index.xml\" rel=\"self\" type=\"application/rss+xml\" />\n  </channel>\n</rss>\n"
  },
  {
    "path": "docs/using/index.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>\n<rss version=\"2.0\" xmlns:atom=\"http://www.w3.org/2005/Atom\">\n  <channel>\n    <title>Using on Editor</title>\n    <link>https://billthefarmer.github.io/editor/using/</link>\n    <description>Recent content in Using on Editor</description>\n    <generator>Hugo</generator>\n    <language>en-gb</language>\n    <copyright>Copyright &amp;copy; 2006 Bill Farmer</copyright>\n    <lastBuildDate>Sun, 18 Feb 2024 10:54:01 +0000</lastBuildDate>\n    <atom:link href=\"https://billthefarmer.github.io/editor/using/index.xml\" rel=\"self\" type=\"application/rss+xml\" />\n    <item>\n      <title>Toolbar</title>\n      <link>https://billthefarmer.github.io/editor/using/toolbar/</link>\n      <pubDate>Wed, 04 Mar 2020 16:06:10 +0000</pubDate>\n      <guid>https://billthefarmer.github.io/editor/using/toolbar/</guid>\n      <description>&lt;p&gt;There are five toolbar items which may appear:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Edit&lt;/strong&gt; – Edit the current read only file&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;View&lt;/strong&gt; – View the current file read only&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Save&lt;/strong&gt; – Save the current file if modified&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;New&lt;/strong&gt; – Start a new empty file&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Open&lt;/strong&gt; – Open a text file using a chooser&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;And on the menu:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Open recent&lt;/strong&gt; – Pop up a list of recent files&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Clear list&lt;/strong&gt; – Clear list of recent files&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Search&lt;/strong&gt; – Interactive search of text using a regular&#xA;expression&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Find all&lt;/strong&gt; – Find all recent files containing search text&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Save as&lt;/strong&gt; – Save the current file with a new name&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Go to&lt;/strong&gt; – Scroll to selected position in file&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;View markdown&lt;/strong&gt; – View markdown in browser or html viewer&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Charset&lt;/strong&gt; – Select character set, shows current set&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Options&lt;/strong&gt; – Select options&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;View files&lt;/strong&gt; – Open files read only for viewing&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Open last&lt;/strong&gt; – Open last opened file on startup&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Auto save&lt;/strong&gt; – Save the current file on app pause&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Word wrap&lt;/strong&gt; – Limit text width to screen width and word wrap&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Suggestions&lt;/strong&gt; – Text input and spelling suggestions&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Highlight syntax&lt;/strong&gt; – Highlight programming language syntax&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Theme&lt;/strong&gt; – Choose theme&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Light&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Dark&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;System&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;White&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Black&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Retro&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Text size&lt;/strong&gt; – Choose text size&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Small&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Medium&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Large&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Typeface&lt;/strong&gt; – Choose typeface&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Monospace&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Proportional&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;About&lt;/strong&gt; – Show version, copyright and licence&lt;/li&gt;&#xA;&lt;/ul&gt;</description>\n    </item>\n    <item>\n      <title>Open</title>\n      <link>https://billthefarmer.github.io/editor/using/open/</link>\n      <pubDate>Wed, 04 Mar 2020 19:32:49 +0000</pubDate>\n      <guid>https://billthefarmer.github.io/editor/using/open/</guid>\n      <description>&lt;p&gt;Choose a file to open from the chooser dialog that pops up. The file&#xA;will initially be read-only. Touch the Edit toolbar item to enable&#xA;editing.&lt;/p&gt;&#xA;&lt;p&gt;The chooser shows a scrollable row of folder buttons and list of files&#xA;with icons. Files which appear to be media files, or are too large&#xA;will be disabled and not selectable. Touch a folder button or a folder&#xA;to change folder, or a file to open a file. Hidden files beginning&#xA;with a &amp;lsquo;.&amp;rsquo; will not appear.&lt;/p&gt;</description>\n    </item>\n    <item>\n      <title>Open Recent</title>\n      <link>https://billthefarmer.github.io/editor/using/open-recent/</link>\n      <pubDate>Wed, 04 Mar 2020 19:32:37 +0000</pubDate>\n      <guid>https://billthefarmer.github.io/editor/using/open-recent/</guid>\n      <description>&lt;p&gt;Choose a file from the list that pops up. As above the file will&#xA;initially be read only. The last entry, &lt;strong&gt;Clear list&lt;/strong&gt;, will clear the&#xA;list.&lt;/p&gt;</description>\n    </item>\n    <item>\n      <title>Save As</title>\n      <link>https://billthefarmer.github.io/editor/using/save-as/</link>\n      <pubDate>Wed, 04 Mar 2020 19:33:09 +0000</pubDate>\n      <guid>https://billthefarmer.github.io/editor/using/save-as/</guid>\n      <description>&lt;p&gt;Enter a new file name in the dialog that pops up. Absolute names&#xA;starting with a slash &amp;lsquo;/&amp;rsquo; will be saved in that exact path. Names&#xA;without a starting slash will be saved relative to the main public&#xA;folder, &lt;code&gt;/sdcard/&lt;/code&gt;, or &lt;code&gt;/storage/emulated/0/&lt;/code&gt;. Touch the &lt;strong&gt;Storage&lt;/strong&gt;&#xA;button to use the android file manager to save the file.&lt;/p&gt;</description>\n    </item>\n    <item>\n      <title>Search</title>\n      <link>https://billthefarmer.github.io/editor/using/search/</link>\n      <pubDate>Wed, 04 Mar 2020 19:38:08 +0000</pubDate>\n      <guid>https://billthefarmer.github.io/editor/using/search/</guid>\n      <description>&lt;p&gt;&lt;img src=&#34;images/Editor-search.png&#34; alt=&#34;Search&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;Enter search text in the field that pops up in the toolbar. The first&#xA;matching item will be highlighted. Use the search button in the&#xA;keyboard for find next. The exact regular expression syntax used is in&#xA;the android documentation for &lt;a href=&#34;https://developer.android.com/reference/java/util/regex/Pattern#sum&#34;&gt;Pattern&lt;/a&gt;.&lt;/p&gt;</description>\n    </item>\n    <item>\n      <title>Findall</title>\n      <link>https://billthefarmer.github.io/editor/using/findall/</link>\n      <pubDate>Thu, 26 Mar 2020 09:56:27 +0000</pubDate>\n      <guid>https://billthefarmer.github.io/editor/using/findall/</guid>\n      <description>&lt;p&gt;&lt;img src=&#34;images/Editor-findall.png&#34; alt=&#34;FindAll&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;You may find all recent files that contain the current search&#xA;text. This menu item will only appear while the search widget is&#xA;active. A dialog will pop up with a list of matching files. Touch an&#xA;entry to open that file. You may repeat this or refine the search text&#xA;to find the desired file.&lt;/p&gt;</description>\n    </item>\n    <item>\n      <title>Go to</title>\n      <link>https://billthefarmer.github.io/editor/using/goto/</link>\n      <pubDate>Thu, 17 Nov 2022 09:49:16 +0000</pubDate>\n      <guid>https://billthefarmer.github.io/editor/using/goto/</guid>\n      <description>&lt;p&gt;&lt;img src=&#34;images/Editor-goto.png&#34; alt=&#34;Go to&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;Select position in the current file on the horizontal seek bar in the&#xA;dialog which will pop up.&lt;/p&gt;</description>\n    </item>\n    <item>\n      <title>Print</title>\n      <link>https://billthefarmer.github.io/editor/using/print/</link>\n      <pubDate>Sat, 26 Nov 2022 09:54:15 +0000</pubDate>\n      <guid>https://billthefarmer.github.io/editor/using/print/</guid>\n      <description>&lt;p&gt;&lt;img src=&#34;images/Editor-print.png&#34; alt=&#34;Print&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;Print the current file. If you would like the output highlighted, you&#xA;will need to scroll slowly through the whole file to give the app a&#xA;chance to highlight it. &lt;strong&gt;Caution&lt;/strong&gt; – Attempting to print a&#xA;large file on an older device with limited resources may cause the app&#xA;to stop responding.&lt;/p&gt;</description>\n    </item>\n    <item>\n      <title>View Markdown</title>\n      <link>https://billthefarmer.github.io/editor/using/view-markdown/</link>\n      <pubDate>Wed, 04 Mar 2020 19:40:02 +0000</pubDate>\n      <guid>https://billthefarmer.github.io/editor/using/view-markdown/</guid>\n      <description>&lt;p&gt;You will be prompted to choose a viewer for an html file containing&#xA;the encoded markdown from the current open file. If the text contains&#xA;no markdown the result will be the same text.&lt;/p&gt;</description>\n    </item>\n    <item>\n      <title>Character set</title>\n      <link>https://billthefarmer.github.io/editor/using/charset/</link>\n      <pubDate>Wed, 03 Nov 2021 21:12:12 +0000</pubDate>\n      <guid>https://billthefarmer.github.io/editor/using/charset/</guid>\n      <description>&lt;p&gt;&lt;img src=&#34;images/Editor-charset.png&#34; alt=&#34;Charset&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;The current character set is displayed under the current file name. The character set is detected when a new file is read. It may be changed by selecting the Charset item in the menu, which shows the current character set.&lt;/p&gt;&#xA;&lt;h4 id=&#34;default&#34;&gt;Default&lt;/h4&gt;&#xA;&lt;p&gt;The default character set is set to UTF-8 on selecting New from the toolbar. It may be changed in the menu. Android defaults to UTF-8, don&amp;rsquo;t use anything else unless you are sure what you are doing.&lt;/p&gt;</description>\n    </item>\n    <item>\n      <title>Typeface</title>\n      <link>https://billthefarmer.github.io/editor/using/typeface/</link>\n      <pubDate>Sun, 18 Feb 2024 10:54:01 +0000</pubDate>\n      <guid>https://billthefarmer.github.io/editor/using/typeface/</guid>\n      <description>&lt;p&gt;&lt;img src=&#34;images/Editor-typeface.png&#34; alt=&#34;Typeface&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;The &lt;strong&gt;Typeface&lt;/strong&gt; menu item shows a choice of common typefaces. These&#xA;are aliases for the fonts commonly provided on android devices. Some&#xA;of them resolve to the same font, depending on the device.&lt;/p&gt;</description>\n    </item>\n    <item>\n      <title>Regular Expressions</title>\n      <link>https://billthefarmer.github.io/editor/using/regular-expressions/</link>\n      <pubDate>Sun, 05 Sep 2021 09:48:08 +0100</pubDate>\n      <guid>https://billthefarmer.github.io/editor/using/regular-expressions/</guid>\n      <description>&lt;p&gt;Explaining &lt;a href=&#34;https://en.wikipedia.org/wiki/Regular_expression&#34;&gt;regular expressions&lt;/a&gt; used in the text search is beyond&#xA;the scope of these docs. There is at least one &lt;a href=&#34;https://www.oreilly.com/library/view/mastering-regular-expressions/0596528124/&#34;&gt;book&lt;/a&gt; (of many)&#xA;devoted to the subject. Use &lt;code&gt;(?i)&lt;/code&gt; for case insensitive search, &lt;code&gt;.&lt;/code&gt;&#xA;matches any character once, &lt;code&gt;.?&lt;/code&gt; matches any character once or not at&#xA;all, &lt;code&gt;.+&lt;/code&gt; matches any character one or more times, &lt;code&gt;.*&lt;/code&gt; matches any&#xA;character any times or not at all. Use &lt;code&gt;.+?&lt;/code&gt; or &lt;code&gt;.*?&lt;/code&gt; for reluctant&#xA;versions. Use &lt;code&gt;\\b&lt;/code&gt; for a word boundary, &lt;code&gt;\\d&lt;/code&gt; for a digit, &lt;code&gt;\\s&lt;/code&gt; for a&#xA;white space character, &lt;code&gt;\\w&lt;/code&gt; for a word character, so &lt;code&gt;\\w+&lt;/code&gt; matches&#xA;words. Use &lt;code&gt;[abc]&lt;/code&gt; to match a set of characters, or &lt;code&gt;[a-z]&lt;/code&gt; for a&#xA;range, so &lt;code&gt;\\w*[aeiou]+\\w*&lt;/code&gt; should match any word with at least one&#xA;vowel in it.&lt;/p&gt;</description>\n    </item>\n    <item>\n      <title>Shortcuts</title>\n      <link>https://billthefarmer.github.io/editor/using/shortcut/</link>\n      <pubDate>Wed, 02 Mar 2022 09:34:09 +0000</pubDate>\n      <guid>https://billthefarmer.github.io/editor/using/shortcut/</guid>\n      <description>&lt;p&gt;&lt;img src=&#34;images/Editor-widgets.png&#34; alt=&#34;Shortcut&#34;&gt; &lt;img src=&#34;images/Editor-shortcut.png&#34; alt=&#34;Shortcut&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;images/Editor-open.png&#34; alt=&#34;Shortcut&#34;&gt; &lt;img src=&#34;images/Editor-name.png&#34; alt=&#34;Shortcut&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;You may create a &lt;strong&gt;New file&lt;/strong&gt; or an &lt;strong&gt;Open file&lt;/strong&gt; shortcut in the&#xA;launcher. The &lt;strong&gt;New file&lt;/strong&gt; widget will create an shortcut to open a&#xA;new file in Editor. The &lt;strong&gt;Open file&lt;/strong&gt; widget will pop up a dialog&#xA;showing the file chooser. You may choose a file or use the &lt;strong&gt;Storage&lt;/strong&gt;&#xA;button. You may cancel and fill in the name and path fields, or edit&#xA;the name or path fields after choosing a file. Use the &lt;strong&gt;Create&lt;/strong&gt;&#xA;button to create the shortcut. &lt;strong&gt;Note&lt;/strong&gt; – content URIs returned&#xA;by the android file picker will not be resolved.&lt;/p&gt;</description>\n    </item>\n    <item>\n      <title>Highlight Syntax</title>\n      <link>https://billthefarmer.github.io/editor/using/highlight-syntax/</link>\n      <pubDate>Wed, 04 Mar 2020 19:41:14 +0000</pubDate>\n      <guid>https://billthefarmer.github.io/editor/using/highlight-syntax/</guid>\n      <description>&lt;p&gt;&lt;img src=&#34;images/Editor-syntax.png&#34; alt=&#34;Syntax&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;If the current open file is a C, C++, Objective C, Dart, Go, Java,&#xA;Javascript, Python, Rust, Shell script, Swift, CSS, HTML, &lt;a href=&#34;https://orgmode.org&#34; title=&#34;https://orgmode.org&#34;&gt;Emacs&#xA;Org&lt;/a&gt; or Markdown file, the keywords, classes comments, strings, etc&#xA;will be highlighted.&lt;/p&gt;&#xA;&lt;h3 id=&#34;selection&#34;&gt;Selection&lt;/h3&gt;&#xA;&lt;p&gt;The type of highlighting is selected by file extension. Files with&#xA;&lt;code&gt;.c&lt;/code&gt;, &lt;code&gt;.cc&lt;/code&gt;, &lt;code&gt;.c++&lt;/code&gt;, &lt;code&gt;.cxx&lt;/code&gt;, &lt;code&gt;.m&lt;/code&gt;, &lt;code&gt;.h&lt;/code&gt;, &lt;code&gt;.dart&lt;/code&gt;, &lt;code&gt;.go&lt;/code&gt;, &lt;code&gt;.js&lt;/code&gt;,&#xA;&lt;code&gt;.java&lt;/code&gt;, &lt;code&gt;.py&lt;/code&gt;, &lt;code&gt;.rs&lt;/code&gt;, &lt;code&gt;.sh&lt;/code&gt;, &lt;code&gt;.swift&lt;/code&gt; extensions will be highlighted&#xA;with &amp;lsquo;C&amp;rsquo; style highlighting. Files with &lt;code&gt;.htm&lt;/code&gt;, &lt;code&gt;.html&lt;/code&gt; extensions&#xA;will be highlighted as HTML. Files with &lt;code&gt;.cs&lt;/code&gt;, &lt;code&gt;.css&lt;/code&gt; extensions will&#xA;be highlighted as CSS. Files with &lt;code&gt;.md&lt;/code&gt; extensions will be highlighted&#xA;as markdown. Files with &lt;code&gt;.org&lt;/code&gt; extensions will be highlighted as Emacs&#xA;Org.&lt;/p&gt;</description>\n    </item>\n    <item>\n      <title>Mode Line</title>\n      <link>https://billthefarmer.github.io/editor/using/mode-line/</link>\n      <pubDate>Wed, 04 Mar 2020 17:41:40 +0000</pubDate>\n      <guid>https://billthefarmer.github.io/editor/using/mode-line/</guid>\n      <description>&lt;p&gt;If a line of text is found within the first or last two or three lines&#xA;of the file which matches the mode line pattern, the mode of the&#xA;editor will be changed after the file is loaded.  The pattern is one&#xA;or more text or punctuation characters, white space, the text &lt;code&gt;ed:&lt;/code&gt;&#xA;followed by one or more option patterns separated by white space.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;# ed: [[no]vw] [[no]ww] [[no]sg] [[no]hs] [cs:u] [th:l|d|s|w|b|r] [ts:l|m|s] [tf:m|p|s]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;The initial text or punctuation characters are intended to be used to&#xA;hide the mode line from compilers and interpreters by commenting it&#xA;out.&lt;/p&gt;</description>\n    </item>\n    <item>\n      <title>Word Count</title>\n      <link>https://billthefarmer.github.io/editor/using/word-count/</link>\n      <pubDate>Mon, 29 Mar 2021 18:47:58 +0100</pubDate>\n      <guid>https://billthefarmer.github.io/editor/using/word-count/</guid>\n      <description>&lt;p&gt;The file word count and character count are shown in the toolbar. Due&#xA;to the algorithm used, the result may differ from that produced by&#xA;other utilities.&lt;/p&gt;</description>\n    </item>\n    <item>\n      <title>Extended Selection</title>\n      <link>https://billthefarmer.github.io/editor/using/extended-selection/</link>\n      <pubDate>Wed, 04 Mar 2020 17:42:02 +0000</pubDate>\n      <guid>https://billthefarmer.github.io/editor/using/extended-selection/</guid>\n      <description>&lt;p&gt;If the file being edited is not a plain text file, selections created&#xA;by double tapping or long touching on the text will be extended to&#xA;enclosing delimiters (brackets, quotes) on the same text line.&lt;/p&gt;</description>\n    </item>\n    <item>\n      <title>Text Size</title>\n      <link>https://billthefarmer.github.io/editor/using/text-size/</link>\n      <pubDate>Fri, 16 Jul 2021 09:14:58 +0100</pubDate>\n      <guid>https://billthefarmer.github.io/editor/using/text-size/</guid>\n      <description>&lt;p&gt;Text size may be changed from the menu or by pinch or expand gestures on the text or by doubletap and swipe. The response to gestures on large files may be slow or delayed.&lt;/p&gt;</description>\n    </item>\n    <item>\n      <title>Unsaved File</title>\n      <link>https://billthefarmer.github.io/editor/using/unsaved-file/</link>\n      <pubDate>Wed, 04 Mar 2020 17:42:32 +0000</pubDate>\n      <guid>https://billthefarmer.github.io/editor/using/unsaved-file/</guid>\n      <description>&lt;p&gt;If you touch the new, back or open button, and the current file has&#xA;been modified, you will be prompted whether you want to save it, else&#xA;the editor will just exit or open a file chooser. The current file may&#xA;be saved on app pause using the menu option. The scroll position and&#xA;name will be remembered for the last 10 files opened.&lt;/p&gt;</description>\n    </item>\n    <item>\n      <title>Changed File</title>\n      <link>https://billthefarmer.github.io/editor/using/changed-file/</link>\n      <pubDate>Wed, 04 Mar 2020 17:42:49 +0000</pubDate>\n      <guid>https://billthefarmer.github.io/editor/using/changed-file/</guid>\n      <description>&lt;p&gt;If a file has changed in storage while it was open in the editor, if&#xA;you attempt to save it, or the app is resumed, you will be prompted&#xA;whether to overwrite or reload the file.&lt;/p&gt;</description>\n    </item>\n    <item>\n      <title>Default File</title>\n      <link>https://billthefarmer.github.io/editor/using/default-file/</link>\n      <pubDate>Wed, 04 Mar 2020 17:43:09 +0000</pubDate>\n      <guid>https://billthefarmer.github.io/editor/using/default-file/</guid>\n      <description>&lt;p&gt;If there is no open file any text entered will by default be saved in&#xA;&lt;code&gt;Documents/Editor.txt&lt;/code&gt;. This file will be loaded on start if it&#xA;exists. Use the &lt;strong&gt;Save as&lt;/strong&gt; menu item to save it elsewhere.&lt;/p&gt;</description>\n    </item>\n    <item>\n      <title>Shared File</title>\n      <link>https://billthefarmer.github.io/editor/using/shared-file/</link>\n      <pubDate>Wed, 04 Mar 2020 17:43:39 +0000</pubDate>\n      <guid>https://billthefarmer.github.io/editor/using/shared-file/</guid>\n      <description>&lt;p&gt;Text files opened or shared by another app may be viewed and&#xA;edited. Some apps may share files or text using a &lt;code&gt;content&lt;/code&gt; URI that&#xA;is not resolvable to a path to a file in storage. In that case the&#xA;editor will read the file into a new file. The &lt;strong&gt;Save&lt;/strong&gt; item will save&#xA;the file in the original location if possible.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt; – Apps that share files will usually only give another&#xA;app read permission. Use the &lt;strong&gt;Save as&lt;/strong&gt; menu item to save the file&#xA;elsewhere.&lt;/p&gt;</description>\n    </item>\n    <item>\n      <title>Keyboard Shortcuts</title>\n      <link>https://billthefarmer.github.io/editor/using/keyboard-shortcuts/</link>\n      <pubDate>Wed, 21 Jul 2021 19:22:29 +0100</pubDate>\n      <guid>https://billthefarmer.github.io/editor/using/keyboard-shortcuts/</guid>\n      <description>&lt;p&gt;When using an external keyboard, some keyboard shortcuts are&#xA;implemented:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Ctrl+E – Edit mode&lt;/li&gt;&#xA;&lt;li&gt;Ctrl+Shift+E – View mode&lt;/li&gt;&#xA;&lt;li&gt;Ctrl+F – Search&lt;/li&gt;&#xA;&lt;li&gt;Ctrl+Shift+F – Close search&lt;/li&gt;&#xA;&lt;li&gt;Ctrl+Alt+F – Find next&lt;/li&gt;&#xA;&lt;li&gt;Ctrl+G – Go to&lt;/li&gt;&#xA;&lt;li&gt;Ctrl+M – Show menu&lt;/li&gt;&#xA;&lt;li&gt;Ctrl+N – New file&lt;/li&gt;&#xA;&lt;li&gt;Ctrl+O – Open file&lt;/li&gt;&#xA;&lt;li&gt;Ctrl+S – Save file&lt;/li&gt;&#xA;&lt;li&gt;Ctrl+Shift+S – Save as&lt;/li&gt;&#xA;&lt;li&gt;Ctrl++ – Increase text size&lt;/li&gt;&#xA;&lt;li&gt;Ctrl+- – Decrease text size&lt;/li&gt;&#xA;&lt;li&gt;F3 – Find next&lt;/li&gt;&#xA;&lt;li&gt;F10 – Show menu&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Many other shortcuts – Ctrl+A, Ctrl+C, Ctrl+V, Ctrl+X, Ctrl+Z&#xA;are already build in to android.&lt;/p&gt;</description>\n    </item>\n  </channel>\n</rss>\n"
  },
  {
    "path": "fastlane/metadata/android/en/changelogs/1193.txt",
    "content": " * Add serif and sans typeface\n * Update mime types\n"
  },
  {
    "path": "fastlane/metadata/android/en/changelogs/162.txt",
    "content": "* Update file provider URI resolution\n* Update build scripts\n"
  },
  {
    "path": "fastlane/metadata/android/en/changelogs/163.txt",
    "content": "* Character set detection and selection\n* File size check on loading\n"
  },
  {
    "path": "fastlane/metadata/android/en/changelogs/164.txt",
    "content": "* Update Portuguese translation\n"
  },
  {
    "path": "fastlane/metadata/android/en/changelogs/165.txt",
    "content": "* Update French translation\n* Remove menu radio buttons"
  },
  {
    "path": "fastlane/metadata/android/en/changelogs/166.txt",
    "content": "* Add fix for OxygenOS, android 11\n"
  },
  {
    "path": "fastlane/metadata/android/en/changelogs/167.txt",
    "content": "* Ellipsize open recent menu\n"
  },
  {
    "path": "fastlane/metadata/android/en/changelogs/168.txt",
    "content": "* Fix ellipsize open recent menu\n"
  },
  {
    "path": "fastlane/metadata/android/en/changelogs/169.txt",
    "content": "* Change charset detector to Mozilla UniversalChardet"
  },
  {
    "path": "fastlane/metadata/android/en/changelogs/170.txt",
    "content": " * Update themes\n"
  },
  {
    "path": "fastlane/metadata/android/en/changelogs/171.txt",
    "content": " * Add new file shortcut\n"
  },
  {
    "path": "fastlane/metadata/android/en/changelogs/172.txt",
    "content": " * Optional character set detection\n * Hungarian translation updated\n"
  },
  {
    "path": "fastlane/metadata/android/en/changelogs/173.txt",
    "content": " * Add Emacs Org syntax highlighting\n * Update shell script syntax highlighting\n"
  },
  {
    "path": "fastlane/metadata/android/en/changelogs/174.txt",
    "content": " * Add Japanese translation\n"
  },
  {
    "path": "fastlane/metadata/android/en/changelogs/175.txt",
    "content": " * Fix Japanese grammar\n * Fix save check\n"
  },
  {
    "path": "fastlane/metadata/android/en/changelogs/176.txt",
    "content": " * Add goto dialog\n"
  },
  {
    "path": "fastlane/metadata/android/en/changelogs/177.txt",
    "content": " * Add print option\n"
  },
  {
    "path": "fastlane/metadata/android/en/changelogs/178.txt",
    "content": " * Add Ukranian translation\n"
  },
  {
    "path": "fastlane/metadata/android/en/changelogs/179.txt",
    "content": " * Update save as dialog\n * Update goto dialog\n * Update save content URI\n"
  },
  {
    "path": "fastlane/metadata/android/en/changelogs/180.txt",
    "content": " * Update file picker, intent filter\n"
  },
  {
    "path": "fastlane/metadata/android/en/changelogs/181.txt",
    "content": " * Update text selection\n"
  },
  {
    "path": "fastlane/metadata/android/en/changelogs/182.txt",
    "content": " * Add white theme\n"
  },
  {
    "path": "fastlane/metadata/android/en/changelogs/183.txt",
    "content": " * Update black, retro themes\n"
  },
  {
    "path": "fastlane/metadata/android/en/changelogs/184.txt",
    "content": " * Update themes, shortcuts\n"
  },
  {
    "path": "fastlane/metadata/android/en/changelogs/185.txt",
    "content": " * Add open last option\n"
  },
  {
    "path": "fastlane/metadata/android/en/changelogs/186.txt",
    "content": " * Add system theme\n * Add open file shortcut\n"
  },
  {
    "path": "fastlane/metadata/android/en/changelogs/187.txt",
    "content": " * Check recent files exist\n"
  },
  {
    "path": "fastlane/metadata/android/en/changelogs/188.txt",
    "content": " * Add Belarusian translation\n"
  },
  {
    "path": "fastlane/metadata/android/en/changelogs/189.txt",
    "content": " * Fix recent file list\n"
  },
  {
    "path": "fastlane/metadata/android/en/changelogs/190.txt",
    "content": " * Update icons\n"
  },
  {
    "path": "fastlane/metadata/android/en/changelogs/191.txt",
    "content": " * Fix search issue\n"
  },
  {
    "path": "fastlane/metadata/android/en/changelogs/192.txt",
    "content": " * Add Basque (eu) translation\n"
  },
  {
    "path": "fastlane/metadata/android/en/changelogs/194.txt",
    "content": " * Add Arabic translation\n * Add keyboard shortcut\n * Add typefaces\n"
  },
  {
    "path": "fastlane/metadata/android/en/changelogs/195.txt",
    "content": " * Add keyboard shortcuts\n"
  },
  {
    "path": "fastlane/metadata/android/en/changelogs/196.txt",
    "content": " * Update Slavic translations\n * Update text resizing\n * Update new file\n"
  },
  {
    "path": "fastlane/metadata/android/en/changelogs/197.txt",
    "content": " * Add Dart and Rust highlighting\n * Update German translation\n * Update SDK, build tools\n"
  },
  {
    "path": "fastlane/metadata/android/en/full_description.txt",
    "content": "This is a very simple generic text editor which may be used standalone or to show or edit any sort of text file from another app. If you select a text file in a file manager or similar app you will be offered the option of using this editor along with whatever other apps you have installed that can show or edit a text file. Files will initially be opened read only, long touch on the display or touch the edit item in the toolbar to enable editing.\n\n * Regular expression text search\n * View markdown in browser or html viewer\n * Optional auto save\n * Optional word wrap\n * Optional suggestions\n * Optional syntax highlighting\n * Character set detection and selection\n * Light/Dark/Black/Retro themes\n * Small/Medium/Large text size\n * Monospace/Proportional typefaces\n"
  },
  {
    "path": "fastlane/metadata/android/en/short_description.txt",
    "content": "Simple generic text editor\n"
  },
  {
    "path": "fastlane/metadata/android/en/title.txt",
    "content": "Editor\n"
  },
  {
    "path": "fastlane/metadata/android/hu/changelogs/162.txt",
    "content": "* Fájlszolgáltató URI feloldásának frissítése\n* Összeállítási parancsfájlok frissítése\n"
  },
  {
    "path": "fastlane/metadata/android/hu/changelogs/163.txt",
    "content": "* Karakterkészlet felismerése és kiválasztása\n* Fájlméret ellenőrzése betöltéskor\n"
  },
  {
    "path": "fastlane/metadata/android/hu/changelogs/164.txt",
    "content": "* Portugál fordítás frissítése\n"
  },
  {
    "path": "fastlane/metadata/android/hu/changelogs/165.txt",
    "content": "* Francia fordítás frissítése\n* Menü választógombjainak eltávolítása\n"
  },
  {
    "path": "fastlane/metadata/android/hu/changelogs/166.txt",
    "content": "* Javítás hozzáadása OxygenOS és Android 11 rendszerekhez\n"
  },
  {
    "path": "fastlane/metadata/android/hu/changelogs/167.txt",
    "content": "* Legutóbbi megnyitása menü hármasponttal ellátása\n"
  },
  {
    "path": "fastlane/metadata/android/hu/changelogs/168.txt",
    "content": "* Legutóbbi megnyitása menü hármasponttal ellátásának javítása\n"
  },
  {
    "path": "fastlane/metadata/android/hu/changelogs/169.txt",
    "content": "* Karakterkészlet-felismerő megváltoztatása a Mozilla UniversalChardet megoldására\n"
  },
  {
    "path": "fastlane/metadata/android/hu/changelogs/170.txt",
    "content": " * Témák frissítése\n"
  },
  {
    "path": "fastlane/metadata/android/hu/changelogs/171.txt",
    "content": " * Új fájl hozzáadása gyorsbillentyű\n"
  },
  {
    "path": "fastlane/metadata/android/hu/full_description.txt",
    "content": "Ez egy nagyon egyszerű, általános szövegszerkesztő, amely önállóan is, vagy bármilyen szöveges fájl egy másik alkalmazásból történő megjelenítésére vagy szerkesztésére is használható. Ha egy fájlkezelőben vagy hasonló alkalmazásban kiválaszt egy szöveges fájlt, akkor felajánlja a lehetőséget, hogy ezt a szerkesztőt bármilyen más, szöveges fájl megjelenítésére vagy szerkesztésére alkalmas telepített alkalmazással együtt használja. A fájlok kezdetben csak olvasásra lesznek megnyitva, a szerkesztés engedélyezéséhez érintse meg hosszan a kijelzőt vagy érintse meg az eszköztáron lévő szerkesztés elemet.\n\n * Szövegkeresés reguláris kifejezéssel\n * Markdown megtekintése a böngészőben vagy a HTML-megjelenítőben\n * Választható automatikus mentés\n * Választható szövegtördelés\n * Választható javaslatok\n * Választható szintaxiskiemelés\n * Karakterkészlet felismerése és kiválasztása\n * Világos, sötét, fekete vagy retró témák\n * Kicsi, közepes vagy nagy szövegméret\n * Rögzített szélességű vagy arányos betűkészletek\n"
  },
  {
    "path": "fastlane/metadata/android/hu/short_description.txt",
    "content": "Egyszerű, általános szövegszerkesztő\n"
  },
  {
    "path": "fastlane/metadata/android/hu/title.txt",
    "content": "Szerkesztő\n"
  },
  {
    "path": "fastlane/metadata/android/ja/changelogs/162.txt",
    "content": "* ファイルプロバイダの URI 解析を更新\n* ビルドスクリプトの更新\n"
  },
  {
    "path": "fastlane/metadata/android/ja/changelogs/163.txt",
    "content": "* 文字セットの検出と選択\n* 読み込み時のファイルサイズチェック\n"
  },
  {
    "path": "fastlane/metadata/android/ja/changelogs/164.txt",
    "content": "* ポルトガル語の翻訳を更新\n"
  },
  {
    "path": "fastlane/metadata/android/ja/changelogs/165.txt",
    "content": "* ポルトガル語の翻訳を更新\n"
  },
  {
    "path": "fastlane/metadata/android/ja/changelogs/166.txt",
    "content": "* OxygenOS、android 11の修正を追加しました。\n"
  },
  {
    "path": "fastlane/metadata/android/ja/changelogs/167.txt",
    "content": "* 最近開いたメニューを楕円形にする\n"
  },
  {
    "path": "fastlane/metadata/android/ja/changelogs/168.txt",
    "content": "* 最近使ったメニューの楕円の大きさを修正\n"
  },
  {
    "path": "fastlane/metadata/android/ja/changelogs/169.txt",
    "content": "* 文字コード検出器をMozilla UniversalChardetに変更する。\n"
  },
  {
    "path": "fastlane/metadata/android/ja/changelogs/170.txt",
    "content": " * テーマのアップデート\n"
  },
  {
    "path": "fastlane/metadata/android/ja/changelogs/171.txt",
    "content": " * 新規ファイルショートカットの追加\n"
  },
  {
    "path": "fastlane/metadata/android/ja/changelogs/172.txt",
    "content": " * オプションの文字セット検出\n * ハンガリー語翻訳を更新\n"
  },
  {
    "path": "fastlane/metadata/android/ja/changelogs/173.txt",
    "content": " * Emacs Orgのシンタックスハイライトの追加\n * シェルスクリプトのシンタックスハイライトを更新\n"
  },
  {
    "path": "fastlane/metadata/android/ja/full_description.txt",
    "content": "これは非常にシンプルな汎用テキストエディタで、スタンドアロンで使用することも、他のアプリからあらゆる種類のテキストファイルを表示または編集することもできます。ファイルマネージャーや同様のアプリでテキストファイルを選択すると、テキストファイルを表示または編集できる他のアプリがインストールされている場合は、このエディターを使用するオプションが提供されます。初期状態では、ファイルは読み取り専用で開かれます。ディスプレイをロングタッチするか、ツールバーの編集項目をタッチすると、編集が可能になります。\n\n * 正規表現によるテキスト検索\n * ブラウザやHTMLビューアでのマークダウン表示\n * オプションの自動保存\n * オプションのワードラップ\n * オプションのサジェスト\n * オプションの構文強調表示\n * 文字セットの検出と選択\n * ライト/ダーク/ブラック/レトロテーマ\n * 文字サイズ（小・中・大\n * 等幅/プロポーショナル書体\n"
  },
  {
    "path": "fastlane/metadata/android/ja/short_description.txt",
    "content": "シンプルな汎用テキストエディタ\n"
  },
  {
    "path": "fastlane/metadata/android/ja/title.txt",
    "content": "エディター\n"
  },
  {
    "path": "gradle/wrapper/gradle-wrapper.properties",
    "content": "distributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\ndistributionUrl=https\\://services.gradle.org/distributions/gradle-8.13-bin.zip\nzipStoreBase=GRADLE_USER_HOME\nzipStorePath=wrapper/dists\n"
  },
  {
    "path": "gradle.properties",
    "content": "android.nonTransitiveRClass=false\nandroid.nonFinalResIds=false\norg.gradle.jvmargs=-Xmx1536M\n"
  },
  {
    "path": "gradlew",
    "content": "#!/bin/sh\n\n#\n# Copyright © 2015-2021 the original authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\n##############################################################################\n#\n#   Gradle start up script for POSIX generated by Gradle.\n#\n#   Important for running:\n#\n#   (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is\n#       noncompliant, but you have some other compliant shell such as ksh or\n#       bash, then to run this script, type that shell name before the whole\n#       command line, like:\n#\n#           ksh Gradle\n#\n#       Busybox and similar reduced shells will NOT work, because this script\n#       requires all of these POSIX shell features:\n#         * functions;\n#         * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,\n#           «${var#prefix}», «${var%suffix}», and «$( cmd )»;\n#         * compound commands having a testable exit status, especially «case»;\n#         * various built-in commands including «command», «set», and «ulimit».\n#\n#   Important for patching:\n#\n#   (2) This script targets any POSIX shell, so it avoids extensions provided\n#       by Bash, Ksh, etc; in particular arrays are avoided.\n#\n#       The \"traditional\" practice of packing multiple parameters into a\n#       space-separated string is a well documented source of bugs and security\n#       problems, so this is (mostly) avoided, by progressively accumulating\n#       options in \"$@\", and eventually passing that to Java.\n#\n#       Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,\n#       and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;\n#       see the in-line comments for details.\n#\n#       There are tweaks for specific operating systems such as AIX, CygWin,\n#       Darwin, MinGW, and NonStop.\n#\n#   (3) This script is generated from the Groovy template\n#       https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt\n#       within the Gradle project.\n#\n#       You can find Gradle at https://github.com/gradle/gradle/.\n#\n##############################################################################\n\n# Attempt to set APP_HOME\n\n# Resolve links: $0 may be a link\napp_path=$0\n\n# Need this for daisy-chained symlinks.\nwhile\n    APP_HOME=${app_path%\"${app_path##*/}\"}  # leaves a trailing /; empty if no leading path\n    [ -h \"$app_path\" ]\ndo\n    ls=$( ls -ld \"$app_path\" )\n    link=${ls#*' -> '}\n    case $link in             #(\n      /*)   app_path=$link ;; #(\n      *)    app_path=$APP_HOME$link ;;\n    esac\ndone\n\nAPP_HOME=$( cd \"${APP_HOME:-./}\" && pwd -P ) || exit\n\nAPP_NAME=\"Gradle\"\nAPP_BASE_NAME=${0##*/}\n\n# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\nDEFAULT_JVM_OPTS='\"-Xmx64m\" \"-Xms64m\"'\n\n# Use the maximum available, or set MAX_FD != -1 to use that value.\nMAX_FD=maximum\n\nwarn () {\n    echo \"$*\"\n} >&2\n\ndie () {\n    echo\n    echo \"$*\"\n    echo\n    exit 1\n} >&2\n\n# OS specific support (must be 'true' or 'false').\ncygwin=false\nmsys=false\ndarwin=false\nnonstop=false\ncase \"$( uname )\" in                #(\n  CYGWIN* )         cygwin=true  ;; #(\n  Darwin* )         darwin=true  ;; #(\n  MSYS* | MINGW* )  msys=true    ;; #(\n  NONSTOP* )        nonstop=true ;;\nesac\n\nCLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar\n\n\n# Determine the Java command to use to start the JVM.\nif [ -n \"$JAVA_HOME\" ] ; then\n    if [ -x \"$JAVA_HOME/jre/sh/java\" ] ; then\n        # IBM's JDK on AIX uses strange locations for the executables\n        JAVACMD=$JAVA_HOME/jre/sh/java\n    else\n        JAVACMD=$JAVA_HOME/bin/java\n    fi\n    if [ ! -x \"$JAVACMD\" ] ; then\n        die \"ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\n    fi\nelse\n    JAVACMD=java\n    which java >/dev/null 2>&1 || die \"ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\nfi\n\n# Increase the maximum file descriptors if we can.\nif ! \"$cygwin\" && ! \"$darwin\" && ! \"$nonstop\" ; then\n    case $MAX_FD in #(\n      max*)\n        MAX_FD=$( ulimit -H -n ) ||\n            warn \"Could not query maximum file descriptor limit\"\n    esac\n    case $MAX_FD in  #(\n      '' | soft) :;; #(\n      *)\n        ulimit -n \"$MAX_FD\" ||\n            warn \"Could not set maximum file descriptor limit to $MAX_FD\"\n    esac\nfi\n\n# Collect all arguments for the java command, stacking in reverse order:\n#   * args from the command line\n#   * the main class name\n#   * -classpath\n#   * -D...appname settings\n#   * --module-path (only if needed)\n#   * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.\n\n# For Cygwin or MSYS, switch paths to Windows format before running java\nif \"$cygwin\" || \"$msys\" ; then\n    APP_HOME=$( cygpath --path --mixed \"$APP_HOME\" )\n    CLASSPATH=$( cygpath --path --mixed \"$CLASSPATH\" )\n\n    JAVACMD=$( cygpath --unix \"$JAVACMD\" )\n\n    # Now convert the arguments - kludge to limit ourselves to /bin/sh\n    for arg do\n        if\n            case $arg in                                #(\n              -*)   false ;;                            # don't mess with options #(\n              /?*)  t=${arg#/} t=/${t%%/*}              # looks like a POSIX filepath\n                    [ -e \"$t\" ] ;;                      #(\n              *)    false ;;\n            esac\n        then\n            arg=$( cygpath --path --ignore --mixed \"$arg\" )\n        fi\n        # Roll the args list around exactly as many times as the number of\n        # args, so each arg winds up back in the position where it started, but\n        # possibly modified.\n        #\n        # NB: a `for` loop captures its iteration list before it begins, so\n        # changing the positional parameters here affects neither the number of\n        # iterations, nor the values presented in `arg`.\n        shift                   # remove old arg\n        set -- \"$@\" \"$arg\"      # push replacement arg\n    done\nfi\n\n# Collect all arguments for the java command;\n#   * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of\n#     shell script including quotes and variable substitutions, so put them in\n#     double quotes to make sure that they get re-expanded; and\n#   * put everything else in single quotes, so that it's not re-expanded.\n\nset -- \\\n        \"-Dorg.gradle.appname=$APP_BASE_NAME\" \\\n        -classpath \"$CLASSPATH\" \\\n        org.gradle.wrapper.GradleWrapperMain \\\n        \"$@\"\n\n# Use \"xargs\" to parse quoted args.\n#\n# With -n1 it outputs one arg per line, with the quotes and backslashes removed.\n#\n# In Bash we could simply go:\n#\n#   readarray ARGS < <( xargs -n1 <<<\"$var\" ) &&\n#   set -- \"${ARGS[@]}\" \"$@\"\n#\n# but POSIX shell has neither arrays nor command substitution, so instead we\n# post-process each arg (as a line of input to sed) to backslash-escape any\n# character that might be a shell metacharacter, then use eval to reverse\n# that process (while maintaining the separation between arguments), and wrap\n# the whole thing up as a single \"set\" statement.\n#\n# This will of course break if any of these variables contains a newline or\n# an unmatched quote.\n#\n\neval \"set -- $(\n        printf '%s\\n' \"$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS\" |\n        xargs -n1 |\n        sed ' s~[^-[:alnum:]+,./:=@_]~\\\\&~g; ' |\n        tr '\\n' ' '\n    )\" '\"$@\"'\n\nexec \"$JAVACMD\" \"$@\"\n"
  },
  {
    "path": "gradlew.bat",
    "content": "@rem\n@rem Copyright 2015 the original author or authors.\n@rem\n@rem Licensed under the Apache License, Version 2.0 (the \"License\");\n@rem you may not use this file except in compliance with the License.\n@rem You may obtain a copy of the License at\n@rem\n@rem      https://www.apache.org/licenses/LICENSE-2.0\n@rem\n@rem Unless required by applicable law or agreed to in writing, software\n@rem distributed under the License is distributed on an \"AS IS\" BASIS,\n@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n@rem See the License for the specific language governing permissions and\n@rem limitations under the License.\n@rem\n\n@if \"%DEBUG%\" == \"\" @echo off\n@rem ##########################################################################\n@rem\n@rem  Gradle startup script for Windows\n@rem\n@rem ##########################################################################\n\n@rem Set local scope for the variables with windows NT shell\nif \"%OS%\"==\"Windows_NT\" setlocal\n\nset DIRNAME=%~dp0\nif \"%DIRNAME%\" == \"\" set DIRNAME=.\nset APP_BASE_NAME=%~n0\nset APP_HOME=%DIRNAME%\n\n@rem Resolve any \".\" and \"..\" in APP_HOME to make it shorter.\nfor %%i in (\"%APP_HOME%\") do set APP_HOME=%%~fi\n\n@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\nset DEFAULT_JVM_OPTS=\"-Xmx64m\" \"-Xms64m\"\n\n@rem Find java.exe\nif defined JAVA_HOME goto findJavaFromJavaHome\n\nset JAVA_EXE=java.exe\n%JAVA_EXE% -version >NUL 2>&1\nif \"%ERRORLEVEL%\" == \"0\" goto execute\n\necho.\necho ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\necho.\necho Please set the JAVA_HOME variable in your environment to match the\necho location of your Java installation.\n\ngoto fail\n\n:findJavaFromJavaHome\nset JAVA_HOME=%JAVA_HOME:\"=%\nset JAVA_EXE=%JAVA_HOME%/bin/java.exe\n\nif exist \"%JAVA_EXE%\" goto execute\n\necho.\necho ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%\necho.\necho Please set the JAVA_HOME variable in your environment to match the\necho location of your Java installation.\n\ngoto fail\n\n:execute\n@rem Setup the command line\n\nset CLASSPATH=%APP_HOME%\\gradle\\wrapper\\gradle-wrapper.jar\n\n\n@rem Execute Gradle\n\"%JAVA_EXE%\" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% \"-Dorg.gradle.appname=%APP_BASE_NAME%\" -classpath \"%CLASSPATH%\" org.gradle.wrapper.GradleWrapperMain %*\n\n:end\n@rem End local scope for the variables with windows NT shell\nif \"%ERRORLEVEL%\"==\"0\" goto mainEnd\n\n:fail\nrem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of\nrem the _cmd.exe /c_ return code!\nif  not \"\" == \"%GRADLE_EXIT_CONSOLE%\" exit 1\nexit /b 1\n\n:mainEnd\nif \"%OS%\"==\"Windows_NT\" endlocal\n\n:omega\n"
  },
  {
    "path": "src/main/AndroidManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:installLocation=\"auto\"\n    tools:ignore=\"GoogleAppIndexingWarning\">\n\n  <uses-permission android:name=\"android.permission.MANAGE_EXTERNAL_STORAGE\" />\n  <uses-permission android:name=\"android.permission.READ_EXTERNAL_STORAGE\" />\n  <uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\" />\n  <uses-permission android:name=\"com.android.launcher.permission.INSTALL_SHORTCUT\" />\n\n  <application\n      android:allowBackup=\"true\"\n      android:icon=\"@drawable/ic_launcher\"\n      android:label=\"@string/appName\"\n      android:theme=\"@style/AppDarkTheme\"\n      android:requestLegacyExternalStorage=\"true\"\n      tools:ignore=\"AllowBackup,UnusedAttribute\">\n\n    <activity\n\tandroid:name=\"Editor\"\n\tandroid:exported=\"true\"\n        tools:ignore=\"\"\n        android:documentLaunchMode=\"always\">\n      <intent-filter>\n        <action android:name=\"android.intent.action.MAIN\" />\n        <category android:name=\"android.intent.category.LAUNCHER\" />\n      </intent-filter>\n      <intent-filter\n          android:scheme=\"http\" tools:ignore=\"AppLinkUrlError\">\n        <action android:name=\"android.intent.action.EDIT\" />\n        <action android:name=\"android.intent.action.SEND\" />\n        <action android:name=\"android.intent.action.VIEW\" />\n\n        <category android:name=\"android.intent.category.DEFAULT\" />\n        <data android:mimeType=\"text/*\" />\n      </intent-filter>\n      <intent-filter\n          android:scheme=\"http\" tools:ignore=\"AppLinkUrlError\">\n        <action android:name=\"android.intent.action.EDIT\" />\n        <action android:name=\"android.intent.action.SEND\" />\n        <action android:name=\"android.intent.action.VIEW\" />\n\n        <category android:name=\"android.intent.category.DEFAULT\" />\n        <data android:mimeType=\"image/svg+xml\" />\n      </intent-filter>\n      <intent-filter\n          android:scheme=\"http\" tools:ignore=\"AppLinkUrlError\">\n        <action android:name=\"android.intent.action.EDIT\" />\n        <action android:name=\"android.intent.action.SEND\" />\n        <action android:name=\"android.intent.action.VIEW\" />\n\n        <category android:name=\"android.intent.category.DEFAULT\" />\n        <data android:mimeType=\"application/*\" />\n      </intent-filter>\n\n      <meta-data android:name=\"android.app.shortcuts\"\n                 android:resource=\"@xml/shortcuts\" />\n    </activity>\n\n    <activity\n        android:name=\"NewFile\"\n        android:exported=\"true\"\n        android:label=\"@string/newFile\"\n        android:theme=\"@android:style/Theme.NoDisplay\">\n      <intent-filter>\n        <action android:name=\"android.intent.action.CREATE_SHORTCUT\" />\n        <category android:name=\"android.intent.category.DEFAULT\" />\n      </intent-filter>\n    </activity>\n\n    <activity\n        android:name=\"OpenFile\"\n        android:exported=\"true\"\n        android:label=\"@string/openFile\"\n        android:theme=\"@style/DialogTheme\">\n      <intent-filter>\n        <action android:name=\"android.intent.action.CREATE_SHORTCUT\" />\n        <category android:name=\"android.intent.category.DEFAULT\" />\n      </intent-filter>\n    </activity>\n\n    <provider\n        android:name=\"android.support.v4.content.FileProvider\"\n        android:authorities=\"org.billthefarmer.editor.fileprovider\"\n        android:exported=\"false\"\n        android:grantUriPermissions=\"true\">\n      <meta-data\n          android:name=\"android.support.FILE_PROVIDER_PATHS\"\n          android:resource=\"@xml/filepaths\" />\n    </provider>\n\n  </application>\n\n</manifest>\n"
  },
  {
    "path": "src/main/java/android/support/v4/content/FileProvider.java",
    "content": "/*\n * Copyright (C) 2013 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage android.support.v4.content;\n\nimport static org.xmlpull.v1.XmlPullParser.END_DOCUMENT;\nimport static org.xmlpull.v1.XmlPullParser.START_TAG;\n\nimport android.content.ContentProvider;\nimport android.content.ContentValues;\nimport android.content.Context;\nimport android.content.Intent;\nimport android.content.pm.PackageManager;\nimport android.content.pm.ProviderInfo;\nimport android.content.res.XmlResourceParser;\nimport android.database.Cursor;\nimport android.database.MatrixCursor;\nimport android.net.Uri;\nimport android.os.Environment;\nimport android.os.ParcelFileDescriptor;\nimport android.provider.OpenableColumns;\n// import android.support.annotation.GuardedBy;\nimport android.text.TextUtils;\nimport android.webkit.MimeTypeMap;\n\nimport org.xmlpull.v1.XmlPullParserException;\n\nimport java.io.File;\nimport java.io.FileNotFoundException;\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * FileProvider is a special subclass of {@link ContentProvider} that facilitates secure sharing\n * of files associated with an app by creating a <code>content://</code> {@link Uri} for a file\n * instead of a <code>file:///</code> {@link Uri}.\n * <p>\n * A content URI allows you to grant read and write access using\n * temporary access permissions. When you create an {@link Intent} containing\n * a content URI, in order to send the content URI\n * to a client app, you can also call {@link Intent#setFlags(int) Intent.setFlags()} to add\n * permissions. These permissions are available to the client app for as long as the stack for\n * a receiving {@link android.app.Activity} is active. For an {@link Intent} going to a\n * {@link android.app.Service}, the permissions are available as long as the\n * {@link android.app.Service} is running.\n * <p>\n * In comparison, to control access to a <code>file:///</code> {@link Uri} you have to modify the\n * file system permissions of the underlying file. The permissions you provide become available to\n * <em>any</em> app, and remain in effect until you change them. This level of access is\n * fundamentally insecure.\n * <p>\n * The increased level of file access security offered by a content URI\n * makes FileProvider a key part of Android's security infrastructure.\n * <p>\n * This overview of FileProvider includes the following topics:\n * </p>\n * <ol>\n *     <li><a href=\"#ProviderDefinition\">Defining a FileProvider</a></li>\n *     <li><a href=\"#SpecifyFiles\">Specifying Available Files</a></li>\n *     <li><a href=\"#GetUri\">Retrieving the Content URI for a File</li>\n *     <li><a href=\"#Permissions\">Granting Temporary Permissions to a URI</a></li>\n *     <li><a href=\"#ServeUri\">Serving a Content URI to Another App</a></li>\n * </ol>\n * <h3 id=\"ProviderDefinition\">Defining a FileProvider</h3>\n * <p>\n * Since the default functionality of FileProvider includes content URI generation for files, you\n * don't need to define a subclass in code. Instead, you can include a FileProvider in your app\n * by specifying it entirely in XML. To specify the FileProvider component itself, add a\n * <code><a href=\"{@docRoot}guide/topics/manifest/provider-element.html\">&lt;provider&gt;</a></code>\n * element to your app manifest. Set the <code>android:name</code> attribute to\n * <code>android.support.v4.content.FileProvider</code>. Set the <code>android:authorities</code>\n * attribute to a URI authority based on a domain you control; for example, if you control the\n * domain <code>mydomain.com</code> you should use the authority\n * <code>com.mydomain.fileprovider</code>. Set the <code>android:exported</code> attribute to\n * <code>false</code>; the FileProvider does not need to be public. Set the\n * <a href=\"{@docRoot}guide/topics/manifest/provider-element.html#gprmsn\"\n * >android:grantUriPermissions</a> attribute to <code>true</code>, to allow you\n * to grant temporary access to files. For example:\n * <pre class=\"prettyprint\">\n *&lt;manifest&gt;\n *    ...\n *    &lt;application&gt;\n *        ...\n *        &lt;provider\n *            android:name=\"android.support.v4.content.FileProvider\"\n *            android:authorities=\"com.mydomain.fileprovider\"\n *            android:exported=\"false\"\n *            android:grantUriPermissions=\"true\"&gt;\n *            ...\n *        &lt;/provider&gt;\n *        ...\n *    &lt;/application&gt;\n *&lt;/manifest&gt;</pre>\n * <p>\n * If you want to override any of the default behavior of FileProvider methods, extend\n * the FileProvider class and use the fully-qualified class name in the <code>android:name</code>\n * attribute of the <code>&lt;provider&gt;</code> element.\n * <h3 id=\"SpecifyFiles\">Specifying Available Files</h3>\n * A FileProvider can only generate a content URI for files in directories that you specify\n * beforehand. To specify a directory, specify the its storage area and path in XML, using child\n * elements of the <code>&lt;paths&gt;</code> element.\n * For example, the following <code>paths</code> element tells FileProvider that you intend to\n * request content URIs for the <code>images/</code> subdirectory of your private file area.\n * <pre class=\"prettyprint\">\n *&lt;paths xmlns:android=\"http://schemas.android.com/apk/res/android\"&gt;\n *    &lt;files-path name=\"my_images\" path=\"images/\"/&gt;\n *    ...\n *&lt;/paths&gt;\n *</pre>\n * <p>\n * The <code>&lt;paths&gt;</code> element must contain one or more of the following child elements:\n * </p>\n * <dl>\n *     <dt>\n * <pre class=\"prettyprint\">\n *&lt;files-path name=\"<i>name</i>\" path=\"<i>path</i>\" /&gt;\n *</pre>\n *     </dt>\n *     <dd>\n *     Represents files in the <code>files/</code> subdirectory of your app's internal storage\n *     area. This subdirectory is the same as the value returned by {@link Context#getFilesDir()\n *     Context.getFilesDir()}.\n *     </dd>\n *     <dt>\n * <pre>\n *&lt;cache-path name=\"<i>name</i>\" path=\"<i>path</i>\" /&gt;\n *</pre>\n *     <dt>\n *     <dd>\n *     Represents files in the cache subdirectory of your app's internal storage area. The root path\n *     of this subdirectory is the same as the value returned by {@link Context#getCacheDir()\n *     getCacheDir()}.\n *     </dd>\n *     <dt>\n * <pre class=\"prettyprint\">\n *&lt;external-path name=\"<i>name</i>\" path=\"<i>path</i>\" /&gt;\n *</pre>\n *     </dt>\n *     <dd>\n *     Represents files in the root of the external storage area. The root path of this subdirectory\n *     is the same as the value returned by\n *     {@link Environment#getExternalStorageDirectory() Environment.getExternalStorageDirectory()}.\n *     </dd>\n *     <dt>\n * <pre class=\"prettyprint\">\n *&lt;external-files-path name=\"<i>name</i>\" path=\"<i>path</i>\" /&gt;\n *</pre>\n *     </dt>\n *     <dd>\n *     Represents files in the root of your app's external storage area. The root path of this\n *     subdirectory is the same as the value returned by\n *     {@code Context#getExternalFilesDir(String) Context.getExternalFilesDir(null)}.\n *     </dd>\n *     <dt>\n * <pre class=\"prettyprint\">\n *&lt;external-cache-path name=\"<i>name</i>\" path=\"<i>path</i>\" /&gt;\n *</pre>\n *     </dt>\n *     <dd>\n *     Represents files in the root of your app's external cache area. The root path of this\n *     subdirectory is the same as the value returned by\n *     {@link Context#getExternalCacheDir() Context.getExternalCacheDir()}.\n *     </dd>\n * </dl>\n * <p>\n *     These child elements all use the same attributes:\n * </p>\n * <dl>\n *     <dt>\n *         <code>name=\"<i>name</i>\"</code>\n *     </dt>\n *     <dd>\n *         A URI path segment. To enforce security, this value hides the name of the subdirectory\n *         you're sharing. The subdirectory name for this value is contained in the\n *         <code>path</code> attribute.\n *     </dd>\n *     <dt>\n *         <code>path=\"<i>path</i>\"</code>\n *     </dt>\n *     <dd>\n *         The subdirectory you're sharing. While the <code>name</code> attribute is a URI path\n *         segment, the <code>path</code> value is an actual subdirectory name. Notice that the\n *         value refers to a <b>subdirectory</b>, not an individual file or files. You can't\n *         share a single file by its file name, nor can you specify a subset of files using\n *         wildcards.\n *     </dd>\n * </dl>\n * <p>\n * You must specify a child element of <code>&lt;paths&gt;</code> for each directory that contains\n * files for which you want content URIs. For example, these XML elements specify two directories:\n * <pre class=\"prettyprint\">\n *&lt;paths xmlns:android=\"http://schemas.android.com/apk/res/android\"&gt;\n *    &lt;files-path name=\"my_images\" path=\"images/\"/&gt;\n *    &lt;files-path name=\"my_docs\" path=\"docs/\"/&gt;\n *&lt;/paths&gt;\n *</pre>\n * <p>\n * Put the <code>&lt;paths&gt;</code> element and its children in an XML file in your project.\n * For example, you can add them to a new file called <code>res/xml/file_paths.xml</code>.\n * To link this file to the FileProvider, add a\n * <a href=\"{@docRoot}guide/topics/manifest/meta-data-element.html\">&lt;meta-data&gt;</a> element\n * as a child of the <code>&lt;provider&gt;</code> element that defines the FileProvider. Set the\n * <code>&lt;meta-data&gt;</code> element's \"android:name\" attribute to\n * <code>android.support.FILE_PROVIDER_PATHS</code>. Set the element's \"android:resource\" attribute\n * to <code>&#64;xml/file_paths</code> (notice that you don't specify the <code>.xml</code>\n * extension). For example:\n * <pre class=\"prettyprint\">\n *&lt;provider\n *    android:name=\"android.support.v4.content.FileProvider\"\n *    android:authorities=\"com.mydomain.fileprovider\"\n *    android:exported=\"false\"\n *    android:grantUriPermissions=\"true\"&gt;\n *    &lt;meta-data\n *        android:name=\"android.support.FILE_PROVIDER_PATHS\"\n *        android:resource=\"&#64;xml/file_paths\" /&gt;\n *&lt;/provider&gt;\n *</pre>\n * <h3 id=\"GetUri\">Generating the Content URI for a File</h3>\n * <p>\n * To share a file with another app using a content URI, your app has to generate the content URI.\n * To generate the content URI, create a new {@link File} for the file, then pass the {@link File}\n * to {@link #getUriForFile(Context, String, File) getUriForFile()}. You can send the content URI\n * returned by {@link #getUriForFile(Context, String, File) getUriForFile()} to another app in an\n * {@link android.content.Intent}. The client app that receives the content URI can open the file\n * and access its contents by calling\n * {@link android.content.ContentResolver#openFileDescriptor(Uri, String)\n * ContentResolver.openFileDescriptor} to get a {@link ParcelFileDescriptor}.\n * <p>\n * For example, suppose your app is offering files to other apps with a FileProvider that has the\n * authority <code>com.mydomain.fileprovider</code>. To get a content URI for the file\n * <code>default_image.jpg</code> in the <code>images/</code> subdirectory of your internal storage\n * add the following code:\n * <pre class=\"prettyprint\">\n *File imagePath = new File(Context.getFilesDir(), \"images\");\n *File newFile = new File(imagePath, \"default_image.jpg\");\n *Uri contentUri = getUriForFile(getContext(), \"com.mydomain.fileprovider\", newFile);\n *</pre>\n * As a result of the previous snippet,\n * {@link #getUriForFile(Context, String, File) getUriForFile()} returns the content URI\n * <code>content://com.mydomain.fileprovider/my_images/default_image.jpg</code>.\n * <h3 id=\"Permissions\">Granting Temporary Permissions to a URI</h3>\n * To grant an access permission to a content URI returned from\n * {@link #getUriForFile(Context, String, File) getUriForFile()}, do one of the following:\n * <ul>\n * <li>\n *     Call the method\n *     {@link Context#grantUriPermission(String, Uri, int)\n *     Context.grantUriPermission(package, Uri, mode_flags)} for the <code>content://</code>\n *     {@link Uri}, using the desired mode flags. This grants temporary access permission for the\n *     content URI to the specified package, according to the value of the\n *     the <code>mode_flags</code> parameter, which you can set to\n *     {@link Intent#FLAG_GRANT_READ_URI_PERMISSION}, {@link Intent#FLAG_GRANT_WRITE_URI_PERMISSION}\n *     or both. The permission remains in effect until you revoke it by calling\n *     {@link Context#revokeUriPermission(Uri, int) revokeUriPermission()} or until the device\n *     reboots.\n * </li>\n * <li>\n *     Put the content URI in an {@link Intent} by calling {@link Intent#setData(Uri) setData()}.\n * </li>\n * <li>\n *     Next, call the method {@link Intent#setFlags(int) Intent.setFlags()} with either\n *     {@link Intent#FLAG_GRANT_READ_URI_PERMISSION} or\n *     {@link Intent#FLAG_GRANT_WRITE_URI_PERMISSION} or both.\n * </li>\n * <li>\n *     Finally, send the {@link Intent} to\n *     another app. Most often, you do this by calling\n *     {@link android.app.Activity#setResult(int, android.content.Intent) setResult()}.\n *     <p>\n *     Permissions granted in an {@link Intent} remain in effect while the stack of the receiving\n *     {@link android.app.Activity} is active. When the stack finishes, the permissions are\n *     automatically removed. Permissions granted to one {@link android.app.Activity} in a client\n *     app are automatically extended to other components of that app.\n *     </p>\n * </li>\n * </ul>\n * <h3 id=\"ServeUri\">Serving a Content URI to Another App</h3>\n * <p>\n * There are a variety of ways to serve the content URI for a file to a client app. One common way\n * is for the client app to start your app by calling\n * {@link android.app.Activity#startActivityForResult(Intent, int, Bundle) startActivityResult()},\n * which sends an {@link Intent} to your app to start an {@link android.app.Activity} in your app.\n * In response, your app can immediately return a content URI to the client app or present a user\n * interface that allows the user to pick a file. In the latter case, once the user picks the file\n * your app can return its content URI. In both cases, your app returns the content URI in an\n * {@link Intent} sent via {@link android.app.Activity#setResult(int, Intent) setResult()}.\n * </p>\n * <p>\n *  You can also put the content URI in a {@link android.content.ClipData} object and then add the\n *  object to an {@link Intent} you send to a client app. To do this, call\n *  {@link Intent#setClipData(ClipData) Intent.setClipData()}. When you use this approach, you can\n *  add multiple {@link android.content.ClipData} objects to the {@link Intent}, each with its own\n *  content URI. When you call {@link Intent#setFlags(int) Intent.setFlags()} on the {@link Intent}\n *  to set temporary access permissions, the same permissions are applied to all of the content\n *  URIs.\n * </p>\n * <p class=\"note\">\n *  <strong>Note:</strong> The {@link Intent#setClipData(ClipData) Intent.setClipData()} method is\n *  only available in platform version 16 (Android 4.1) and later. If you want to maintain\n *  compatibility with previous versions, you should send one content URI at a time in the\n *  {@link Intent}. Set the action to {@link Intent#ACTION_SEND} and put the URI in data by calling\n *  {@link Intent#setData setData()}.\n * </p>\n * <h3 id=\"\">More Information</h3>\n * <p>\n *    To learn more about FileProvider, see the Android training class\n *    <a href=\"{@docRoot}training/secure-file-sharing/index.html\">Sharing Files Securely with URIs</a>.\n * </p>\n */\npublic class FileProvider extends ContentProvider {\n    private static final String[] COLUMNS = {\n            OpenableColumns.DISPLAY_NAME, OpenableColumns.SIZE };\n\n    private static final String\n            META_DATA_FILE_PROVIDER_PATHS = \"android.support.FILE_PROVIDER_PATHS\";\n\n    private static final String TAG_ROOT_PATH = \"root-path\";\n    private static final String TAG_FILES_PATH = \"files-path\";\n    private static final String TAG_CACHE_PATH = \"cache-path\";\n    private static final String TAG_EXTERNAL = \"external-path\";\n    private static final String TAG_EXTERNAL_FILES = \"external-files-path\";\n    private static final String TAG_EXTERNAL_CACHE = \"external-cache-path\";\n\n    private static final String ATTR_NAME = \"name\";\n    private static final String ATTR_PATH = \"path\";\n\n    private static final File DEVICE_ROOT = new File(\"/\");\n\n    // @GuardedBy(\"sCache\")\n    private static HashMap<String, PathStrategy> sCache = new HashMap<String, PathStrategy>();\n\n    private PathStrategy mStrategy;\n\n    /**\n     * The default FileProvider implementation does not need to be initialized. If you want to\n     * override this method, you must provide your own subclass of FileProvider.\n     */\n    @Override\n    public boolean onCreate() {\n        return true;\n    }\n\n    /**\n     * After the FileProvider is instantiated, this method is called to provide the system with\n     * information about the provider.\n     *\n     * @param context A {@link Context} for the current component.\n     * @param info A {@link ProviderInfo} for the new provider.\n     */\n    @Override\n    public void attachInfo(Context context, ProviderInfo info) {\n        super.attachInfo(context, info);\n\n        // Sanity check our security\n        if (info.exported) {\n            throw new SecurityException(\"Provider must not be exported\");\n        }\n        if (!info.grantUriPermissions) {\n            throw new SecurityException(\"Provider must grant uri permissions\");\n        }\n\n        mStrategy = getPathStrategy(context, info.authority);\n    }\n\n    /**\n     * Return a content URI for a given {@link File}. Specific temporary\n     * permissions for the content URI can be set with\n     * {@link Context#grantUriPermission(String, Uri, int)}, or added\n     * to an {@link Intent} by calling {@link Intent#setData(Uri) setData()} and then\n     * {@link Intent#setFlags(int) setFlags()}; in both cases, the applicable flags are\n     * {@link Intent#FLAG_GRANT_READ_URI_PERMISSION} and\n     * {@link Intent#FLAG_GRANT_WRITE_URI_PERMISSION}. A FileProvider can only return a\n     * <code>content</code> {@link Uri} for file paths defined in their <code>&lt;paths&gt;</code>\n     * meta-data element. See the Class Overview for more information.\n     *\n     * @param context A {@link Context} for the current component.\n     * @param authority The authority of a {@link FileProvider} defined in a\n     *            {@code <provider>} element in your app's manifest.\n     * @param file A {@link File} pointing to the filename for which you want a\n     * <code>content</code> {@link Uri}.\n     * @return A content URI for the file.\n     * @throws IllegalArgumentException When the given {@link File} is outside\n     * the paths supported by the provider.\n     */\n    public static Uri getUriForFile(Context context, String authority, File file) {\n        final PathStrategy strategy = getPathStrategy(context, authority);\n        return strategy.getUriForFile(file);\n    }\n\n    /**\n     * Use a content URI returned by\n     * {@link #getUriForFile(Context, String, File) getUriForFile()} to get information about a file\n     * managed by the FileProvider.\n     * FileProvider reports the column names defined in {@link android.provider.OpenableColumns}:\n     * <ul>\n     * <li>{@link android.provider.OpenableColumns#DISPLAY_NAME}</li>\n     * <li>{@link android.provider.OpenableColumns#SIZE}</li>\n     * </ul>\n     * For more information, see\n     * {@link ContentProvider#query(Uri, String[], String, String[], String)\n     * ContentProvider.query()}.\n     *\n     * @param uri A content URI returned by {@link #getUriForFile}.\n     * @param projection The list of columns to put into the {@link Cursor}. If null all columns are\n     * included.\n     * @param selection Selection criteria to apply. If null then all data that matches the content\n     * URI is returned.\n     * @param selectionArgs An array of {@link java.lang.String}, containing arguments to bind to\n     * the <i>selection</i> parameter. The <i>query</i> method scans <i>selection</i> from left to\n     * right and iterates through <i>selectionArgs</i>, replacing the current \"?\" character in\n     * <i>selection</i> with the value at the current position in <i>selectionArgs</i>. The\n     * values are bound to <i>selection</i> as {@link java.lang.String} values.\n     * @param sortOrder A {@link java.lang.String} containing the column name(s) on which to sort\n     * the resulting {@link Cursor}.\n     * @return A {@link Cursor} containing the results of the query.\n     *\n     */\n    @Override\n    public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs,\n            String sortOrder) {\n        // ContentProvider has already checked granted permissions\n        final File file = mStrategy.getFileForUri(uri);\n\n        if (projection == null) {\n            projection = COLUMNS;\n        }\n\n        String[] cols = new String[projection.length];\n        Object[] values = new Object[projection.length];\n        int i = 0;\n        for (String col : projection) {\n            if (OpenableColumns.DISPLAY_NAME.equals(col)) {\n                cols[i] = OpenableColumns.DISPLAY_NAME;\n                values[i++] = file.getName();\n            } else if (OpenableColumns.SIZE.equals(col)) {\n                cols[i] = OpenableColumns.SIZE;\n                values[i++] = file.length();\n            }\n        }\n\n        cols = copyOf(cols, i);\n        values = copyOf(values, i);\n\n        final MatrixCursor cursor = new MatrixCursor(cols, 1);\n        cursor.addRow(values);\n        return cursor;\n    }\n\n    /**\n     * Returns the MIME type of a content URI returned by\n     * {@link #getUriForFile(Context, String, File) getUriForFile()}.\n     *\n     * @param uri A content URI returned by\n     * {@link #getUriForFile(Context, String, File) getUriForFile()}.\n     * @return If the associated file has an extension, the MIME type associated with that\n     * extension; otherwise <code>application/octet-stream</code>.\n     */\n    @Override\n    public String getType(Uri uri) {\n        // ContentProvider has already checked granted permissions\n        final File file = mStrategy.getFileForUri(uri);\n\n        final int lastDot = file.getName().lastIndexOf('.');\n        if (lastDot >= 0) {\n            final String extension = file.getName().substring(lastDot + 1);\n            final String mime = MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension);\n            if (mime != null) {\n                return mime;\n            }\n        }\n\n        return \"application/octet-stream\";\n    }\n\n    /**\n     * By default, this method throws an {@link java.lang.UnsupportedOperationException}. You must\n     * subclass FileProvider if you want to provide different functionality.\n     */\n    @Override\n    public Uri insert(Uri uri, ContentValues values) {\n        throw new UnsupportedOperationException(\"No external inserts\");\n    }\n\n    /**\n     * By default, this method throws an {@link java.lang.UnsupportedOperationException}. You must\n     * subclass FileProvider if you want to provide different functionality.\n     */\n    @Override\n    public int update(Uri uri, ContentValues values, String selection, String[] selectionArgs) {\n        throw new UnsupportedOperationException(\"No external updates\");\n    }\n\n    /**\n     * Deletes the file associated with the specified content URI, as\n     * returned by {@link #getUriForFile(Context, String, File) getUriForFile()}. Notice that this\n     * method does <b>not</b> throw an {@link java.io.IOException}; you must check its return value.\n     *\n     * @param uri A content URI for a file, as returned by\n     * {@link #getUriForFile(Context, String, File) getUriForFile()}.\n     * @param selection Ignored. Set to {@code null}.\n     * @param selectionArgs Ignored. Set to {@code null}.\n     * @return 1 if the delete succeeds; otherwise, 0.\n     */\n    @Override\n    public int delete(Uri uri, String selection, String[] selectionArgs) {\n        // ContentProvider has already checked granted permissions\n        final File file = mStrategy.getFileForUri(uri);\n        return file.delete() ? 1 : 0;\n    }\n\n    /**\n     * By default, FileProvider automatically returns the\n     * {@link ParcelFileDescriptor} for a file associated with a <code>content://</code>\n     * {@link Uri}. To get the {@link ParcelFileDescriptor}, call\n     * {@link android.content.ContentResolver#openFileDescriptor(Uri, String)\n     * ContentResolver.openFileDescriptor}.\n     *\n     * To override this method, you must provide your own subclass of FileProvider.\n     *\n     * @param uri A content URI associated with a file, as returned by\n     * {@link #getUriForFile(Context, String, File) getUriForFile()}.\n     * @param mode Access mode for the file. May be \"r\" for read-only access, \"rw\" for read and\n     * write access, or \"rwt\" for read and write access that truncates any existing file.\n     * @return A new {@link ParcelFileDescriptor} with which you can access the file.\n     */\n    @Override\n    public ParcelFileDescriptor openFile(Uri uri, String mode) throws FileNotFoundException {\n        // ContentProvider has already checked granted permissions\n        final File file = mStrategy.getFileForUri(uri);\n        final int fileMode = modeToMode(mode);\n        return ParcelFileDescriptor.open(file, fileMode);\n    }\n\n    /**\n     * Return {@link PathStrategy} for given authority, either by parsing or\n     * returning from cache.\n     */\n    private static PathStrategy getPathStrategy(Context context, String authority) {\n        PathStrategy strat;\n        synchronized (sCache) {\n            strat = sCache.get(authority);\n            if (strat == null) {\n                try {\n                    strat = parsePathStrategy(context, authority);\n                } catch (IOException e) {\n                    throw new IllegalArgumentException(\n                            \"Failed to parse \" + META_DATA_FILE_PROVIDER_PATHS + \" meta-data\", e);\n                } catch (XmlPullParserException e) {\n                    throw new IllegalArgumentException(\n                            \"Failed to parse \" + META_DATA_FILE_PROVIDER_PATHS + \" meta-data\", e);\n                }\n                sCache.put(authority, strat);\n            }\n        }\n        return strat;\n    }\n\n    /**\n     * Parse and return {@link PathStrategy} for given authority as defined in\n     * {@link #META_DATA_FILE_PROVIDER_PATHS} {@code <meta-data>}.\n     *\n     * @see #getPathStrategy(Context, String)\n     */\n    private static PathStrategy parsePathStrategy(Context context, String authority)\n            throws IOException, XmlPullParserException {\n        final SimplePathStrategy strat = new SimplePathStrategy(authority);\n\n        final ProviderInfo info = context.getPackageManager()\n                .resolveContentProvider(authority, PackageManager.GET_META_DATA);\n        final XmlResourceParser in = info.loadXmlMetaData(\n                context.getPackageManager(), META_DATA_FILE_PROVIDER_PATHS);\n        if (in == null) {\n            throw new IllegalArgumentException(\n                    \"Missing \" + META_DATA_FILE_PROVIDER_PATHS + \" meta-data\");\n        }\n\n        int type;\n        while ((type = in.next()) != END_DOCUMENT) {\n            if (type == START_TAG) {\n                final String tag = in.getName();\n\n                final String name = in.getAttributeValue(null, ATTR_NAME);\n                String path = in.getAttributeValue(null, ATTR_PATH);\n\n                File target = null;\n                if (TAG_ROOT_PATH.equals(tag)) {\n                    target = DEVICE_ROOT;\n                } else if (TAG_FILES_PATH.equals(tag)) {\n                    target = context.getFilesDir();\n                } else if (TAG_CACHE_PATH.equals(tag)) {\n                    target = context.getCacheDir();\n                } else if (TAG_EXTERNAL.equals(tag)) {\n                    target = Environment.getExternalStorageDirectory();\n                } else if (TAG_EXTERNAL_FILES.equals(tag)) {\n                    target = context.getExternalFilesDir(null);\n                } else if (TAG_EXTERNAL_CACHE.equals(tag)) {\n                    target = context.getExternalCacheDir();\n                }\n\n                if (target != null) {\n                    strat.addRoot(name, buildPath(target, path));\n                }\n            }\n        }\n\n        return strat;\n    }\n\n    /**\n     * Strategy for mapping between {@link File} and {@link Uri}.\n     * <p>\n     * Strategies must be symmetric so that mapping a {@link File} to a\n     * {@link Uri} and then back to a {@link File} points at the original\n     * target.\n     * <p>\n     * Strategies must remain consistent across app launches, and not rely on\n     * dynamic state. This ensures that any generated {@link Uri} can still be\n     * resolved if your process is killed and later restarted.\n     *\n     * @see SimplePathStrategy\n     */\n    interface PathStrategy {\n        /**\n         * Return a {@link Uri} that represents the given {@link File}.\n         */\n        public Uri getUriForFile(File file);\n\n        /**\n         * Return a {@link File} that represents the given {@link Uri}.\n         */\n        public File getFileForUri(Uri uri);\n    }\n\n    /**\n     * Strategy that provides access to files living under a narrow whitelist of\n     * filesystem roots. It will throw {@link SecurityException} if callers try\n     * accessing files outside the configured roots.\n     * <p>\n     * For example, if configured with\n     * {@code addRoot(\"myfiles\", context.getFilesDir())}, then\n     * {@code context.getFileStreamPath(\"foo.txt\")} would map to\n     * {@code content://myauthority/myfiles/foo.txt}.\n     */\n    static class SimplePathStrategy implements PathStrategy {\n        private final String mAuthority;\n        private final HashMap<String, File> mRoots = new HashMap<String, File>();\n\n        public SimplePathStrategy(String authority) {\n            mAuthority = authority;\n        }\n\n        /**\n         * Add a mapping from a name to a filesystem root. The provider only offers\n         * access to files that live under configured roots.\n         */\n        public void addRoot(String name, File root) {\n            if (TextUtils.isEmpty(name)) {\n                throw new IllegalArgumentException(\"Name must not be empty\");\n            }\n\n            try {\n                // Resolve to canonical path to keep path checking fast\n                root = root.getCanonicalFile();\n            } catch (IOException e) {\n                throw new IllegalArgumentException(\n                        \"Failed to resolve canonical path for \" + root, e);\n            }\n\n            mRoots.put(name, root);\n        }\n\n        @Override\n        public Uri getUriForFile(File file) {\n            String path;\n            try {\n                path = file.getCanonicalPath();\n            } catch (IOException e) {\n                throw new IllegalArgumentException(\"Failed to resolve canonical path for \" + file);\n            }\n\n            // Find the most-specific root path\n            Map.Entry<String, File> mostSpecific = null;\n            for (Map.Entry<String, File> root : mRoots.entrySet()) {\n                final String rootPath = root.getValue().getPath();\n                if (path.startsWith(rootPath) && (mostSpecific == null\n                        || rootPath.length() > mostSpecific.getValue().getPath().length())) {\n                    mostSpecific = root;\n                }\n            }\n\n            if (mostSpecific == null) {\n                throw new IllegalArgumentException(\n                        \"Failed to find configured root that contains \" + path);\n            }\n\n            // Start at first char of path under root\n            final String rootPath = mostSpecific.getValue().getPath();\n            if (rootPath.endsWith(\"/\")) {\n                path = path.substring(rootPath.length());\n            } else {\n                path = path.substring(rootPath.length() + 1);\n            }\n\n            // Encode the tag and path separately\n            path = Uri.encode(mostSpecific.getKey()) + '/' + Uri.encode(path, \"/\");\n            return new Uri.Builder().scheme(\"content\")\n                    .authority(mAuthority).encodedPath(path).build();\n        }\n\n        @Override\n        public File getFileForUri(Uri uri) {\n            String path = uri.getEncodedPath();\n\n            final int splitIndex = path.indexOf('/', 1);\n            final String tag = Uri.decode(path.substring(1, splitIndex));\n            path = Uri.decode(path.substring(splitIndex + 1));\n\n            final File root = mRoots.get(tag);\n            if (root == null) {\n                throw new IllegalArgumentException(\"Unable to find configured root for \" + uri);\n            }\n\n            File file = new File(root, path);\n            try {\n                file = file.getCanonicalFile();\n            } catch (IOException e) {\n                throw new IllegalArgumentException(\"Failed to resolve canonical path for \" + file);\n            }\n\n            if (!file.getPath().startsWith(root.getPath())) {\n                throw new SecurityException(\"Resolved path jumped beyond configured root\");\n            }\n\n            return file;\n        }\n    }\n\n    /**\n     * Copied from ContentResolver.java\n     */\n    private static int modeToMode(String mode) {\n        int modeBits;\n        if (\"r\".equals(mode)) {\n            modeBits = ParcelFileDescriptor.MODE_READ_ONLY;\n        } else if (\"w\".equals(mode) || \"wt\".equals(mode)) {\n            modeBits = ParcelFileDescriptor.MODE_WRITE_ONLY\n                    | ParcelFileDescriptor.MODE_CREATE\n                    | ParcelFileDescriptor.MODE_TRUNCATE;\n        } else if (\"wa\".equals(mode)) {\n            modeBits = ParcelFileDescriptor.MODE_WRITE_ONLY\n                    | ParcelFileDescriptor.MODE_CREATE\n                    | ParcelFileDescriptor.MODE_APPEND;\n        } else if (\"rw\".equals(mode)) {\n            modeBits = ParcelFileDescriptor.MODE_READ_WRITE\n                    | ParcelFileDescriptor.MODE_CREATE;\n        } else if (\"rwt\".equals(mode)) {\n            modeBits = ParcelFileDescriptor.MODE_READ_WRITE\n                    | ParcelFileDescriptor.MODE_CREATE\n                    | ParcelFileDescriptor.MODE_TRUNCATE;\n        } else {\n            throw new IllegalArgumentException(\"Invalid mode: \" + mode);\n        }\n        return modeBits;\n    }\n\n    private static File buildPath(File base, String... segments) {\n        File cur = base;\n        for (String segment : segments) {\n            if (segment != null) {\n                cur = new File(cur, segment);\n            }\n        }\n        return cur;\n    }\n\n    private static String[] copyOf(String[] original, int newLength) {\n        final String[] result = new String[newLength];\n        System.arraycopy(original, 0, result, 0, newLength);\n        return result;\n    }\n\n    private static Object[] copyOf(Object[] original, int newLength) {\n        final Object[] result = new Object[newLength];\n        System.arraycopy(original, 0, result, 0, newLength);\n        return result;\n    }\n}\n"
  },
  {
    "path": "src/main/java/com/ibm/icu/text/CharsetDetector.java",
    "content": "// © 2016 and later: Unicode, Inc. and others.\n// License & terms of use: http://www.unicode.org/copyright.html\n/**\n*******************************************************************************\n* Copyright (C) 2005-2016, International Business Machines Corporation and    *\n* others. All Rights Reserved.                                                *\n*******************************************************************************\n*/\npackage com.ibm.icu.text;\n\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.io.Reader;\nimport java.util.ArrayList;\nimport java.util.Arrays;\nimport java.util.Collections;\nimport java.util.List;\n\n\n/**\n * <code>CharsetDetector</code> provides a facility for detecting the\n * charset or encoding of character data in an unknown format.\n * The input data can either be from an input stream or an array of bytes.\n * The result of the detection operation is a list of possibly matching\n * charsets, or, for simple use, you can just ask for a Java Reader that\n * will will work over the input data.\n * <p>\n * Character set detection is at best an imprecise operation.  The detection\n * process will attempt to identify the charset that best matches the characteristics\n * of the byte data, but the process is partly statistical in nature, and\n * the results can not be guaranteed to always be correct.\n * <p>\n * For best accuracy in charset detection, the input data should be primarily\n * in a single language, and a minimum of a few hundred bytes worth of plain text\n * in the language are needed.  The detection process will attempt to\n * ignore html or xml style markup that could otherwise obscure the content.\n * <p>\n * @stable ICU 3.4\n */\npublic class CharsetDetector {\n\n//   Question: Should we have getters corresponding to the setters for input text\n//   and declared encoding?\n\n//   A thought: If we were to create our own type of Java Reader, we could defer\n//   figuring out an actual charset for data that starts out with too much English\n//   only ASCII until the user actually read through to something that didn't look\n//   like 7 bit English.  If  nothing else ever appeared, we would never need to\n//   actually choose the \"real\" charset.  All assuming that the application just\n//   wants the data, and doesn't care about a char set name.\n\n    /**\n     *   Constructor\n     * \n     * @stable ICU 3.4\n     */\n    public CharsetDetector() {\n    }\n\n    /**\n     * Set the declared encoding for charset detection.\n     *  The declared encoding of an input text is an encoding obtained\n     *  from an http header or xml declaration or similar source that\n     *  can be provided as additional information to the charset detector.  \n     *  A match between a declared encoding and a possible detected encoding\n     *  will raise the quality of that detected encoding by a small delta,\n     *  and will also appear as a \"reason\" for the match.\n     * <p>\n     * A declared encoding that is incompatible with the input data being\n     * analyzed will not be added to the list of possible encodings.\n     * \n     *  @param encoding The declared encoding \n     *\n     * @stable ICU 3.4\n     */\n    public CharsetDetector setDeclaredEncoding(String encoding) {\n        fDeclaredEncoding = encoding;\n        return this;\n    }\n    \n    /**\n     * Set the input text (byte) data whose charset is to be detected.\n     * \n     * @param in the input text of unknown encoding\n     * \n     * @return This CharsetDetector\n     *\n     * @stable ICU 3.4\n     */\n    public CharsetDetector setText(byte [] in) {\n        fRawInput  = in;\n        fRawLength = in.length;\n        \n        return this;\n    }\n    \n    private static final int kBufSize = 8000;\n\n    /**\n     * Set the input text (byte) data whose charset is to be detected.\n     *  <p>\n     *   The input stream that supplies the character data must have markSupported()\n     *   == true; the charset detection process will read a small amount of data,\n     *   then return the stream to its original position via\n     *   the InputStream.reset() operation.  The exact amount that will\n     *   be read depends on the characteristics of the data itself.\n     *\n     * @param in the input text of unknown encoding\n     * \n     * @return This CharsetDetector\n     *\n     * @stable ICU 3.4\n     */\n    \n    public CharsetDetector setText(InputStream in) throws IOException {\n        fInputStream = in;\n        fInputStream.mark(kBufSize);\n        fRawInput = new byte[kBufSize];   // Always make a new buffer because the\n                                          //   previous one may have come from the caller,\n                                          //   in which case we can't touch it.\n        fRawLength = 0;\n        int remainingLength = kBufSize;\n        while (remainingLength > 0 ) {\n            // read() may give data in smallish chunks, esp. for remote sources.  Hence, this loop.\n            int  bytesRead = fInputStream.read(fRawInput, fRawLength, remainingLength);\n            if (bytesRead <= 0) {\n                 break;\n            }\n            fRawLength += bytesRead;\n            remainingLength -= bytesRead;\n        }\n        fInputStream.reset();\n        \n        return this;\n    }\n\n  \n    /**\n     * Return the charset that best matches the supplied input data.\n     * \n     * Note though, that because the detection \n     * only looks at the start of the input data,\n     * there is a possibility that the returned charset will fail to handle\n     * the full set of input data.\n     * <p>\n     * Raise an exception if \n     *  <ul>\n     *    <li>no charset appears to match the data.</li>\n     *    <li>no input text has been provided</li>\n     *  </ul>\n     *\n     * @return a CharsetMatch object representing the best matching charset, or\n     *         <code>null</code> if there are no matches.\n     *\n     * @stable ICU 3.4\n     */\n    public CharsetMatch detect() {\n//   TODO:  A better implementation would be to copy the detect loop from\n//          detectAll(), and cut it short as soon as a match with a high confidence\n//          is found.  This is something to be done later, after things are otherwise\n//          working.\n        CharsetMatch matches[] = detectAll();\n        \n        if (matches == null || matches.length == 0) {\n            return null;\n        }\n        \n        return matches[0];\n     }\n    \n    /**\n     *  Return an array of all charsets that appear to be plausible\n     *  matches with the input data.  The array is ordered with the\n     *  best quality match first.\n     * <p>\n     * Raise an exception if \n     *  <ul>\n     *    <li>no charsets appear to match the input data.</li>\n     *    <li>no input text has been provided</li>\n     *  </ul>\n     * \n     * @return An array of CharsetMatch objects representing possibly matching charsets.\n     *\n     * @stable ICU 3.4\n     */\n    public CharsetMatch[] detectAll() {\n        ArrayList<CharsetMatch>         matches = new ArrayList<CharsetMatch>();\n        \n        MungeInput();  // Strip html markup, collect byte stats.\n        \n        //  Iterate over all possible charsets, remember all that\n        //    give a match quality > 0.\n        for (int i = 0; i < ALL_CS_RECOGNIZERS.size(); i++) {\n            CSRecognizerInfo rcinfo = ALL_CS_RECOGNIZERS.get(i);\n            boolean active = (fEnabledRecognizers != null) ? fEnabledRecognizers[i] : rcinfo.isDefaultEnabled;\n            if (active) {\n                CharsetMatch m = rcinfo.recognizer.match(this);\n                if (m != null) {\n                    matches.add(m);\n                }\n            }\n        }\n        Collections.sort(matches);      // CharsetMatch compares on confidence\n        Collections.reverse(matches);   //  Put best match first.\n        CharsetMatch [] resultArray = new CharsetMatch[matches.size()];\n        resultArray = matches.toArray(resultArray);\n        return resultArray;\n    }\n\n    \n    /**\n     * Autodetect the charset of an inputStream, and return a Java Reader\n     * to access the converted input data.\n     * <p>\n     * This is a convenience method that is equivalent to\n     *   <code>this.setDeclaredEncoding(declaredEncoding).setText(in).detect().getReader();</code>\n     * <p>\n     *   For the input stream that supplies the character data, markSupported()\n     *   must be true; the  charset detection will read a small amount of data,\n     *   then return the stream to its original position via\n     *   the InputStream.reset() operation.  The exact amount that will\n     *    be read depends on the characteristics of the data itself.\n     *<p>\n     * Raise an exception if no charsets appear to match the input data.\n     * \n     * @param in The source of the byte data in the unknown charset.\n     *\n     * @param declaredEncoding  A declared encoding for the data, if available,\n     *           or null or an empty string if none is available.\n     *\n     * @stable ICU 3.4\n     */\n    public Reader getReader(InputStream in, String declaredEncoding) {\n        fDeclaredEncoding = declaredEncoding;\n        \n        try {\n            setText(in);\n            \n            CharsetMatch match = detect();\n            \n            if (match == null) {\n                return null;\n            }\n            \n            return match.getReader();\n        } catch (IOException e) {\n            return null;\n        }\n    }\n\n    /**\n     * Autodetect the charset of an inputStream, and return a String\n     * containing the converted input data.\n     * <p>\n     * This is a convenience method that is equivalent to\n     *   <code>this.setDeclaredEncoding(declaredEncoding).setText(in).detect().getString();</code>\n     *<p>\n     * Raise an exception if no charsets appear to match the input data.\n     * \n     * @param in The source of the byte data in the unknown charset.\n     *\n     * @param declaredEncoding  A declared encoding for the data, if available,\n     *           or null or an empty string if none is available.\n     *\n     * @stable ICU 3.4\n     */\n    public String getString(byte[] in, String declaredEncoding)\n    {\n        fDeclaredEncoding = declaredEncoding;\n       \n        try {\n            setText(in);\n            \n            CharsetMatch match = detect();\n            \n            if (match == null) {\n                return null;\n            }\n            \n            return match.getString(-1);\n        } catch (IOException e) {\n            return null;\n        }\n    }\n\n \n    /**\n     * Get the names of all charsets supported by <code>CharsetDetector</code> class.\n     * <p>\n     * <b>Note:</b> Multiple different charset encodings in a same family may use\n     * a single shared name in this implementation. For example, this method returns\n     * an array including \"ISO-8859-1\" (ISO Latin 1), but not including \"windows-1252\"\n     * (Windows Latin 1). However, actual detection result could be \"windows-1252\"\n     * when the input data matches Latin 1 code points with any points only available\n     * in \"windows-1252\".\n     *\n     * @return an array of the names of all charsets supported by\n     * <code>CharsetDetector</code> class.\n     *\n     * @stable ICU 3.4\n     */\n    public static String[] getAllDetectableCharsets() {\n        String[] allCharsetNames = new String[ALL_CS_RECOGNIZERS.size()];\n        for (int i = 0; i < allCharsetNames.length; i++) {\n            allCharsetNames[i] = ALL_CS_RECOGNIZERS.get(i).recognizer.getName();\n        }\n        return allCharsetNames;\n    }   \n       \n    /**\n     * Test whether or not input filtering is enabled.\n     * \n     * @return <code>true</code> if input text will be filtered.\n     * \n     * @see #enableInputFilter\n     *\n     * @stable ICU 3.4\n     */\n    public boolean inputFilterEnabled()\n    {\n        return fStripTags;\n    }\n    \n    /**\n     * Enable filtering of input text. If filtering is enabled,\n     * text within angle brackets (\"&lt;\" and \"&gt;\") will be removed\n     * before detection.\n     * \n     * @param filter <code>true</code> to enable input text filtering.\n     * \n     * @return The previous setting.\n     *\n     * @stable ICU 3.4\n     */\n    public boolean enableInputFilter(boolean filter)\n    {\n        boolean previous = fStripTags;\n        \n        fStripTags = filter;\n        \n        return previous;\n    }\n    \n    /*\n     *  MungeInput - after getting a set of raw input data to be analyzed, preprocess\n     *               it by removing what appears to be html markup.\n     */\n    private void MungeInput() {\n        int srci = 0;\n        int dsti = 0;\n        byte b;\n        boolean  inMarkup = false;\n        int      openTags = 0;\n        int      badTags  = 0;\n        \n        //\n        //  html / xml markup stripping.\n        //     quick and dirty, not 100% accurate, but hopefully good enough, statistically.\n        //     discard everything within < brackets >\n        //     Count how many total '<' and illegal (nested) '<' occur, so we can make some\n        //     guess as to whether the input was actually marked up at all.\n        if (fStripTags) {\n            for (srci = 0; srci < fRawLength && dsti < fInputBytes.length; srci++) {\n                b = fRawInput[srci];\n                if (b == (byte)'<') {\n                    if (inMarkup) {\n                        badTags++;\n                    }\n                    inMarkup = true;\n                    openTags++;\n                }\n                \n                if (! inMarkup) {\n                    fInputBytes[dsti++] = b;\n                }\n                \n                if (b == (byte)'>') {\n                    inMarkup = false;\n                }        \n            }\n            \n            fInputLen = dsti;\n        }\n        \n        //\n        //  If it looks like this input wasn't marked up, or if it looks like it's\n        //    essentially nothing but markup abandon the markup stripping.\n        //    Detection will have to work on the unstripped input.\n        //\n        if (openTags<5 || openTags/5 < badTags || \n                (fInputLen < 100 && fRawLength>600)) {\n            int limit = fRawLength;\n            \n            if (limit > kBufSize) {\n                limit = kBufSize;\n            }\n            \n            for (srci=0; srci<limit; srci++) {\n                fInputBytes[srci] = fRawInput[srci];\n            }\n            fInputLen = srci;\n        }\n        \n        //\n        // Tally up the byte occurrence statistics.\n        //   These are available for use by the various detectors.\n        //\n        Arrays.fill(fByteStats, (short)0);\n        for (srci=0; srci<fInputLen; srci++) {\n            int val = fInputBytes[srci] & 0x00ff;\n            fByteStats[val]++;\n        }\n        \n        fC1Bytes = false;\n        for (int i = 0x80; i <= 0x9F; i += 1) {\n            if (fByteStats[i] != 0) {\n                fC1Bytes = true;\n                break;\n            }\n        }\n     }\n\n    /*\n     *  The following items are accessed by individual CharsetRecongizers during\n     *     the recognition process\n     * \n     */\n    byte[]      fInputBytes =       // The text to be checked.  Markup will have been\n                   new byte[kBufSize];  //   removed if appropriate.\n    \n    int         fInputLen;          // Length of the byte data in fInputBytes.\n    \n    short       fByteStats[] =      // byte frequency statistics for the input text.\n                   new short[256];  //   Value is percent, not absolute.\n                                    //   Value is rounded up, so zero really means zero occurrences.\n    \n    boolean     fC1Bytes =          // True if any bytes in the range 0x80 - 0x9F are in the input;\n                   false;\n    \n    String      fDeclaredEncoding;\n\n\n    byte[]               fRawInput;     // Original, untouched input bytes.\n                                        //  If user gave us a byte array, this is it.\n                                        //  If user gave us a stream, it's read to a \n                                        //  buffer here.\n    int                  fRawLength;    // Length of data in fRawInput array.\n    \n    InputStream          fInputStream;  // User's input stream, or null if the user\n                                        //   gave us a byte array.\n     \n    //\n    //  Stuff private to CharsetDetector\n    //\n    private boolean      fStripTags =   // If true, setText() will strip tags from input text.\n                           false;\n\n    private boolean[]    fEnabledRecognizers;   // If not null, active set of charset recognizers had\n                                                // been changed from the default. The array index is\n                                                // corresponding to ALL_RECOGNIZER. See setDetectableCharset().\n\n    private static class CSRecognizerInfo {\n        CharsetRecognizer recognizer;\n        boolean isDefaultEnabled;\n\n        CSRecognizerInfo(CharsetRecognizer recognizer, boolean isDefaultEnabled) {\n            this.recognizer = recognizer;\n            this.isDefaultEnabled = isDefaultEnabled;\n        }\n    }\n\n    /*\n     * List of recognizers for all charsets known to the implementation.\n     */\n    private static final List<CSRecognizerInfo> ALL_CS_RECOGNIZERS;\n\n    static {\n        List<CSRecognizerInfo> list = new ArrayList<CSRecognizerInfo>();\n\n        list.add(new CSRecognizerInfo(new CharsetRecog_UTF8(), true));\n        list.add(new CSRecognizerInfo(new CharsetRecog_Unicode.CharsetRecog_UTF_16_BE(), true));\n        list.add(new CSRecognizerInfo(new CharsetRecog_Unicode.CharsetRecog_UTF_16_LE(), true));\n        list.add(new CSRecognizerInfo(new CharsetRecog_Unicode.CharsetRecog_UTF_32_BE(), true));\n        list.add(new CSRecognizerInfo(new CharsetRecog_Unicode.CharsetRecog_UTF_32_LE(), true));\n\n        list.add(new CSRecognizerInfo(new CharsetRecog_mbcs.CharsetRecog_sjis(), true));\n        list.add(new CSRecognizerInfo(new CharsetRecog_2022.CharsetRecog_2022JP(), true));\n        list.add(new CSRecognizerInfo(new CharsetRecog_2022.CharsetRecog_2022CN(), true));\n        list.add(new CSRecognizerInfo(new CharsetRecog_2022.CharsetRecog_2022KR(), true));\n        list.add(new CSRecognizerInfo(new CharsetRecog_mbcs.CharsetRecog_euc.CharsetRecog_gb_18030(), true));\n        list.add(new CSRecognizerInfo(new CharsetRecog_mbcs.CharsetRecog_euc.CharsetRecog_euc_jp(), true));\n        list.add(new CSRecognizerInfo(new CharsetRecog_mbcs.CharsetRecog_euc.CharsetRecog_euc_kr(), true));\n        list.add(new CSRecognizerInfo(new CharsetRecog_mbcs.CharsetRecog_big5(), true));\n\n        list.add(new CSRecognizerInfo(new CharsetRecog_sbcs.CharsetRecog_8859_1(), true));\n        list.add(new CSRecognizerInfo(new CharsetRecog_sbcs.CharsetRecog_8859_2(), true));\n        list.add(new CSRecognizerInfo(new CharsetRecog_sbcs.CharsetRecog_8859_5_ru(), true));\n        list.add(new CSRecognizerInfo(new CharsetRecog_sbcs.CharsetRecog_8859_6_ar(), true));\n        list.add(new CSRecognizerInfo(new CharsetRecog_sbcs.CharsetRecog_8859_7_el(), true));\n        list.add(new CSRecognizerInfo(new CharsetRecog_sbcs.CharsetRecog_8859_8_I_he(), true));\n        list.add(new CSRecognizerInfo(new CharsetRecog_sbcs.CharsetRecog_8859_8_he(), true));\n        list.add(new CSRecognizerInfo(new CharsetRecog_sbcs.CharsetRecog_windows_1251(), true));\n        list.add(new CSRecognizerInfo(new CharsetRecog_sbcs.CharsetRecog_windows_1256(), true));\n        list.add(new CSRecognizerInfo(new CharsetRecog_sbcs.CharsetRecog_KOI8_R(), true));\n        list.add(new CSRecognizerInfo(new CharsetRecog_sbcs.CharsetRecog_8859_9_tr(), true));\n\n        // IBM 420/424 recognizers are disabled by default\n        list.add(new CSRecognizerInfo(new CharsetRecog_sbcs.CharsetRecog_IBM424_he_rtl(), false));\n        list.add(new CSRecognizerInfo(new CharsetRecog_sbcs.CharsetRecog_IBM424_he_ltr(), false));\n        list.add(new CSRecognizerInfo(new CharsetRecog_sbcs.CharsetRecog_IBM420_ar_rtl(), false));\n        list.add(new CSRecognizerInfo(new CharsetRecog_sbcs.CharsetRecog_IBM420_ar_ltr(), false));\n\n        ALL_CS_RECOGNIZERS = Collections.unmodifiableList(list);\n    }\n\n    /**\n     * Get the names of charsets that can be recognized by this CharsetDetector instance.\n     *\n     * @return an array of the names of charsets that can be recognized by this CharsetDetector\n     * instance.\n     *\n     * @internal\n     * @deprecated This API is ICU internal only.\n     */\n    @Deprecated\n    public String[] getDetectableCharsets() {\n        List<String> csnames = new ArrayList<String>(ALL_CS_RECOGNIZERS.size());\n        for (int i = 0; i < ALL_CS_RECOGNIZERS.size(); i++) {\n            CSRecognizerInfo rcinfo = ALL_CS_RECOGNIZERS.get(i);\n            boolean active = (fEnabledRecognizers == null) ? rcinfo.isDefaultEnabled : fEnabledRecognizers[i];\n            if (active) {\n                csnames.add(rcinfo.recognizer.getName());\n            }\n        }\n        return csnames.toArray(new String[csnames.size()]);\n    }\n\n    /**\n     * Enable or disable individual charset encoding.\n     * A name of charset encoding must be included in the names returned by\n     * {@link #getAllDetectableCharsets()}.\n     *\n     * @param encoding the name of charset encoding.\n     * @param enabled <code>true</code> to enable, or <code>false</code> to disable the\n     * charset encoding.\n     * @return A reference to this <code>CharsetDetector</code>.\n     * @throws IllegalArgumentException when the name of charset encoding is\n     * not supported.\n     *\n     * @internal\n     * @deprecated This API is ICU internal only.\n     */\n    @Deprecated\n    public CharsetDetector setDetectableCharset(String encoding, boolean enabled) {\n        int modIdx = -1;\n        boolean isDefaultVal = false;\n        for (int i = 0; i < ALL_CS_RECOGNIZERS.size(); i++) {\n            CSRecognizerInfo csrinfo = ALL_CS_RECOGNIZERS.get(i);\n            if (csrinfo.recognizer.getName().equals(encoding)) {\n                modIdx = i;\n                isDefaultVal = (csrinfo.isDefaultEnabled == enabled);\n                break;\n            }\n        }\n        if (modIdx < 0) {\n            // No matching encoding found\n            throw new IllegalArgumentException(\"Invalid encoding: \" + \"\\\"\" + encoding + \"\\\"\");\n        }\n\n        if (fEnabledRecognizers == null && !isDefaultVal) {\n            // Create an array storing the non default setting\n            fEnabledRecognizers = new boolean[ALL_CS_RECOGNIZERS.size()];\n\n            // Initialize the array with default info\n            for (int i = 0; i < ALL_CS_RECOGNIZERS.size(); i++) {\n                fEnabledRecognizers[i] = ALL_CS_RECOGNIZERS.get(i).isDefaultEnabled;\n            }\n        }\n \n        if (fEnabledRecognizers != null) {\n            fEnabledRecognizers[modIdx] = enabled;\n        }\n\n        return this;\n    }\n}\n"
  },
  {
    "path": "src/main/java/com/ibm/icu/text/CharsetMatch.java",
    "content": "// © 2016 and later: Unicode, Inc. and others.\n// License & terms of use: http://www.unicode.org/copyright.html\n/**\n*******************************************************************************\n* Copyright (C) 2005-2016, International Business Machines Corporation and    *\n* others. All Rights Reserved.                                                *\n*******************************************************************************\n*/\npackage com.ibm.icu.text;\n\nimport java.io.ByteArrayInputStream;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.io.InputStreamReader;\nimport java.io.Reader;\n\n\n/**\n * This class represents a charset that has been identified by a CharsetDetector\n * as a possible encoding for a set of input data.  From an instance of this\n * class, you can ask for a confidence level in the charset identification,\n * or for Java Reader or String to access the original byte data in Unicode form.\n * <p>\n * Instances of this class are created only by CharsetDetectors.\n * <p>\n * Note:  this class has a natural ordering that is inconsistent with equals.\n *        The natural ordering is based on the match confidence value.\n *\n * @stable ICU 3.4\n */\npublic class CharsetMatch implements Comparable<CharsetMatch> {\n\n\n    /**\n     * Create a java.io.Reader for reading the Unicode character data corresponding\n     * to the original byte data supplied to the Charset detect operation.\n     * <p>\n     * CAUTION:  if the source of the byte data was an InputStream, a Reader\n     * can be created for only one matching char set using this method.  If more\n     * than one charset needs to be tried, the caller will need to reset\n     * the InputStream and create InputStreamReaders itself, based on the charset name.\n     *\n     * @return the Reader for the Unicode character data.\n     *\n     * @stable ICU 3.4\n     */\n    public Reader getReader() {\n        InputStream inputStream = fInputStream;\n\n        if (inputStream == null) {\n            inputStream = new ByteArrayInputStream(fRawInput, 0, fRawLength);\n        }\n\n        try {\n            inputStream.reset();\n            return new InputStreamReader(inputStream, getName());\n        } catch (IOException e) {\n            return null;\n        }\n    }\n\n    /**\n     * Create a Java String from Unicode character data corresponding\n     * to the original byte data supplied to the Charset detect operation.\n     *\n     * @return a String created from the converted input data.\n     *\n     * @stable ICU 3.4\n     */\n    public String getString()  throws java.io.IOException {\n        return getString(-1);\n\n    }\n\n    /**\n     * Create a Java String from Unicode character data corresponding\n     * to the original byte data supplied to the Charset detect operation.\n     * The length of the returned string is limited to the specified size;\n     * the string will be trunctated to this length if necessary.  A limit value of\n     * zero or less is ignored, and treated as no limit.\n     *\n     * @param maxLength The maximum length of the String to be created when the\n     *                  source of the data is an input stream, or -1 for\n     *                  unlimited length.\n     * @return a String created from the converted input data.\n     *\n     * @stable ICU 3.4\n     */\n    public String getString(int maxLength) throws java.io.IOException {\n        String result = null;\n        if (fInputStream != null) {\n            StringBuilder sb = new StringBuilder();\n            char[] buffer = new char[1024];\n            Reader reader = getReader();\n            int max = maxLength < 0? Integer.MAX_VALUE : maxLength;\n            int bytesRead = 0;\n\n            while ((bytesRead = reader.read(buffer, 0, Math.min(max, 1024))) >= 0) {\n                sb.append(buffer, 0, bytesRead);\n                max -= bytesRead;\n            }\n\n            reader.close();\n\n            return sb.toString();\n        } else {\n            String name = getName();\n            /*\n             * getName() may return a name with a suffix 'rtl' or 'ltr'. This cannot\n             * be used to open a charset (e.g. IBM424_rtl). The ending '_rtl' or 'ltr'\n             * should be stripped off before creating the string.\n             */\n            int startSuffix = name.indexOf(\"_rtl\") < 0 ? name.indexOf(\"_ltr\") : name.indexOf(\"_rtl\");\n            if (startSuffix > 0) {\n                name = name.substring(0, startSuffix);\n            }\n            result = new String(fRawInput, name);\n        }\n        return result;\n\n    }\n\n    /**\n     * Get an indication of the confidence in the charset detected.\n     * Confidence values range from 0-100, with larger numbers indicating\n     * a better match of the input data to the characteristics of the\n     * charset.\n     *\n     * @return the confidence in the charset match\n     *\n     * @stable ICU 3.4\n     */\n    public int getConfidence() {\n        return fConfidence;\n    }\n\n    /**\n     * Get the name of the detected charset.\n     * The name will be one that can be used with other APIs on the\n     * platform that accept charset names.  It is the \"Canonical name\"\n     * as defined by the class java.nio.charset.Charset; for\n     * charsets that are registered with the IANA charset registry,\n     * this is the MIME-preferred registerd name.\n     *\n     * @see java.nio.charset.Charset\n     * @see java.io.InputStreamReader\n     *\n     * @return The name of the charset.\n     *\n     * @stable ICU 3.4\n     */\n    public String getName() {\n        return fCharsetName;\n    }\n\n    /**\n     * Get the ISO code for the language of the detected charset.\n     *\n     * @return The ISO code for the language or <code>null</code> if the language cannot be determined.\n     *\n     * @stable ICU 3.4\n     */\n    public String getLanguage() {\n        return fLang;\n    }\n\n    /**\n     * Compare to other CharsetMatch objects.\n     * Comparison is based on the match confidence value, which\n     *   allows CharsetDetector.detectAll() to order its results.\n     *\n     * @param other the CharsetMatch object to compare against.\n     * @return  a negative integer, zero, or a positive integer as the\n     *          confidence level of this CharsetMatch\n     *          is less than, equal to, or greater than that of\n     *          the argument.\n     * @throws ClassCastException if the argument is not a CharsetMatch.\n     * @stable ICU 4.4\n     */\n    @Override\n    public int compareTo (CharsetMatch other) {\n        int compareResult = 0;\n        if (this.fConfidence > other.fConfidence) {\n            compareResult = 1;\n        } else if (this.fConfidence < other.fConfidence) {\n            compareResult = -1;\n        }\n        return compareResult;\n    }\n\n    /*\n     *  Constructor.  Implementation internal\n     */\n    CharsetMatch(CharsetDetector det, CharsetRecognizer rec, int conf) {\n        fConfidence = conf;\n\n        // The references to the original application input data must be copied out\n        //   of the charset recognizer to here, in case the application resets the\n        //   recognizer before using this CharsetMatch.\n        if (det.fInputStream == null) {\n            // We only want the existing input byte data if it came straight from the user,\n            //   not if is just the head of a stream.\n            fRawInput    = det.fRawInput;\n            fRawLength   = det.fRawLength;\n        }\n        fInputStream = det.fInputStream;\n        fCharsetName = rec.getName();\n        fLang = rec.getLanguage();\n    }\n\n    /*\n     *  Constructor.  Implementation internal\n     */\n    CharsetMatch(CharsetDetector det, CharsetRecognizer rec, int conf, String csName, String lang) {\n        fConfidence = conf;\n\n        // The references to the original application input data must be copied out\n        //   of the charset recognizer to here, in case the application resets the\n        //   recognizer before using this CharsetMatch.\n        if (det.fInputStream == null) {\n            // We only want the existing input byte data if it came straight from the user,\n            //   not if is just the head of a stream.\n            fRawInput    = det.fRawInput;\n            fRawLength   = det.fRawLength;\n        }\n        fInputStream = det.fInputStream;\n        fCharsetName = csName;\n        fLang = lang;\n    }\n\n\n    //\n    //   Private Data\n    //\n    private int                 fConfidence;\n    private byte[]              fRawInput = null;     // Original, untouched input bytes.\n                                                      //  If user gave us a byte array, this is it.\n    private int                 fRawLength;           // Length of data in fRawInput array.\n\n    private InputStream         fInputStream = null;  // User's input stream, or null if the user\n                                                      //   gave us a byte array.\n\n    private String              fCharsetName;         // The name of the charset this CharsetMatch\n                                                      //   represents.  Filled in by the recognizer.\n    private String              fLang;                // The language, if one was determined by\n                                                      //   the recognizer during the detect operation.\n}\n"
  },
  {
    "path": "src/main/java/com/ibm/icu/text/CharsetRecog_2022.java",
    "content": "// © 2016 and later: Unicode, Inc. and others.\n// License & terms of use: http://www.unicode.org/copyright.html\n/*\n*******************************************************************************\n* Copyright (C) 2005 - 2012, International Business Machines Corporation and  *\n* others. All Rights Reserved.                                                *\n*******************************************************************************\n*/\npackage com.ibm.icu.text;\n\n/**\n *  class CharsetRecog_2022  part of the ICU charset detection implementation.\n *                           This is a superclass for the individual detectors for\n *                           each of the detectable members of the ISO 2022 family\n *                           of encodings.\n *\n *                           The separate classes are nested within this class.\n */\nabstract class CharsetRecog_2022 extends CharsetRecognizer {\n\n\n    /**\n     * Matching function shared among the 2022 detectors JP, CN and KR\n     * Counts up the number of legal an unrecognized escape sequences in\n     * the sample of text, and computes a score based on the total number &\n     * the proportion that fit the encoding.\n     *\n     *\n     * @param text the byte buffer containing text to analyse\n     * @param textLen  the size of the text in the byte.\n     * @param escapeSequences the byte escape sequences to test for.\n     * @return match quality, in the range of 0-100.\n     */\n    int   match(byte [] text, int textLen, byte [][] escapeSequences) {\n        int     i, j;\n        int     escN;\n        int     hits   = 0;\n        int     misses = 0;\n        int     shifts = 0;\n        int     quality;\n        scanInput:\n            for (i=0; i<textLen; i++) {\n                if (text[i] == 0x1b) {\n                    checkEscapes:\n                        for (escN=0; escN<escapeSequences.length; escN++) {\n                            byte [] seq = escapeSequences[escN];\n\n                            if ((textLen - i) < seq.length) {\n                                continue checkEscapes;\n                            }\n\n                            for (j=1; j<seq.length; j++) {\n                                if (seq[j] != text[i+j])  {\n                                    continue checkEscapes;\n                                }\n                            }\n\n                            hits++;\n                            i += seq.length-1;\n                            continue scanInput;\n                        }\n\n                        misses++;\n                }\n\n                if (text[i] == 0x0e || text[i] == 0x0f) {\n                    // Shift in/out\n                    shifts++;\n                }\n            }\n\n        if (hits == 0) {\n            return 0;\n        }\n\n        //\n        // Initial quality is based on relative proportion of recognized vs.\n        //   unrecognized escape sequences.\n        //   All good:  quality = 100;\n        //   half or less good: quality = 0;\n        //   linear inbetween.\n        quality = (100*hits - 100*misses) / (hits + misses);\n\n        // Back off quality if there were too few escape sequences seen.\n        //   Include shifts in this computation, so that KR does not get penalized\n        //   for having only a single Escape sequence, but many shifts.\n        if (hits+shifts < 5) {\n            quality -= (5-(hits+shifts))*10;\n        }\n\n        if (quality < 0) {\n            quality = 0;\n        }\n        return quality;\n    }\n\n\n\n\n    static class CharsetRecog_2022JP extends CharsetRecog_2022 {\n        private byte [] [] escapeSequences = {\n                {0x1b, 0x24, 0x28, 0x43},   // KS X 1001:1992\n                {0x1b, 0x24, 0x28, 0x44},   // JIS X 212-1990\n                {0x1b, 0x24, 0x40},         // JIS C 6226-1978\n                {0x1b, 0x24, 0x41},         // GB 2312-80\n                {0x1b, 0x24, 0x42},         // JIS X 208-1983\n                {0x1b, 0x26, 0x40},         // JIS X 208 1990, 1997\n                {0x1b, 0x28, 0x42},         // ASCII\n                {0x1b, 0x28, 0x48},         // JIS-Roman\n                {0x1b, 0x28, 0x49},         // Half-width katakana\n                {0x1b, 0x28, 0x4a},         // JIS-Roman\n                {0x1b, 0x2e, 0x41},         // ISO 8859-1\n                {0x1b, 0x2e, 0x46}          // ISO 8859-7\n                };\n\n        @Override\n        String getName() {\n            return \"ISO-2022-JP\";\n        }\n\n        @Override\n        CharsetMatch   match(CharsetDetector det) {\n            int confidence = match(det.fInputBytes, det.fInputLen, escapeSequences);\n            return confidence == 0 ? null : new CharsetMatch(det, this, confidence);\n        }\n    }\n\n    static class CharsetRecog_2022KR extends CharsetRecog_2022 {\n        private byte [] [] escapeSequences = {\n                {0x1b, 0x24, 0x29, 0x43}\n                 };\n\n        @Override\n        String getName() {\n            return \"ISO-2022-KR\";\n        }\n\n        @Override\n        CharsetMatch   match(CharsetDetector det) {\n            int confidence =  match(det.fInputBytes, det.fInputLen, escapeSequences);\n            return confidence == 0 ? null : new CharsetMatch(det, this, confidence);\n        }\n    }\n\n    static class CharsetRecog_2022CN extends CharsetRecog_2022 {\n        private byte [] [] escapeSequences = {\n                {0x1b, 0x24, 0x29, 0x41},   // GB 2312-80\n                {0x1b, 0x24, 0x29, 0x47},   // CNS 11643-1992 Plane 1\n                {0x1b, 0x24, 0x2A, 0x48},   // CNS 11643-1992 Plane 2\n                {0x1b, 0x24, 0x29, 0x45},   // ISO-IR-165\n                {0x1b, 0x24, 0x2B, 0x49},   // CNS 11643-1992 Plane 3\n                {0x1b, 0x24, 0x2B, 0x4A},   // CNS 11643-1992 Plane 4\n                {0x1b, 0x24, 0x2B, 0x4B},   // CNS 11643-1992 Plane 5\n                {0x1b, 0x24, 0x2B, 0x4C},   // CNS 11643-1992 Plane 6\n                {0x1b, 0x24, 0x2B, 0x4D},   // CNS 11643-1992 Plane 7\n                {0x1b, 0x4e},               // SS2\n                {0x1b, 0x4f},               // SS3\n        };\n\n        @Override\n        String getName() {\n            return \"ISO-2022-CN\";\n        }\n\n        @Override\n        CharsetMatch   match(CharsetDetector det) {\n            int confidence = match(det.fInputBytes, det.fInputLen, escapeSequences);\n            return confidence == 0 ? null : new CharsetMatch(det, this, confidence);\n        }\n    }\n\n}\n\n"
  },
  {
    "path": "src/main/java/com/ibm/icu/text/CharsetRecog_UTF8.java",
    "content": "// © 2016 and later: Unicode, Inc. and others.\n// License & terms of use: http://www.unicode.org/copyright.html\n/**\n*******************************************************************************\n* Copyright (C) 2005 - 2014, International Business Machines Corporation and  *\n* others. All Rights Reserved.                                                *\n*******************************************************************************\n*/\npackage com.ibm.icu.text;\n\n/**\n * Charset recognizer for UTF-8\n */\nclass CharsetRecog_UTF8 extends CharsetRecognizer {\n\n    @Override\n    String getName() {\n        return \"UTF-8\";\n    }\n\n    /* (non-Javadoc)\n     * @see com.ibm.icu.text.CharsetRecognizer#match(com.ibm.icu.text.CharsetDetector)\n     */\n    @Override\n    CharsetMatch match(CharsetDetector det) {\n        boolean     hasBOM = false;\n        int         numValid = 0;\n        int         numInvalid = 0;\n        byte        input[] = det.fRawInput;\n        int         i;\n        int         trailBytes = 0;\n        int         confidence;\n\n        if (det.fRawLength >= 3 &&\n                (input[0] & 0xFF) == 0xef && (input[1] & 0xFF) == 0xbb && (input[2] & 0xFF) == 0xbf) {\n            hasBOM = true;\n        }\n\n        // Scan for multi-byte sequences\n        for (i=0; i<det.fRawLength; i++) {\n            int b = input[i];\n            if ((b & 0x80) == 0) {\n                continue;   // ASCII\n            }\n\n            // Hi bit on char found.  Figure out how long the sequence should be\n            if ((b & 0x0e0) == 0x0c0) {\n                trailBytes = 1;\n            } else if ((b & 0x0f0) == 0x0e0) {\n                trailBytes = 2;\n            } else if ((b & 0x0f8) == 0xf0) {\n                trailBytes = 3;\n            } else {\n                numInvalid++;\n                continue;\n            }\n\n            // Verify that we've got the right number of trail bytes in the sequence\n            for (;;) {\n                i++;\n                if (i>=det.fRawLength) {\n                    break;\n                }\n                b = input[i];\n                if ((b & 0xc0) != 0x080) {\n                    numInvalid++;\n                    break;\n                }\n                if (--trailBytes == 0) {\n                    numValid++;\n                    break;\n                }\n            }\n        }\n\n        // Cook up some sort of confidence score, based on presence of a BOM\n        //    and the existence of valid and/or invalid multi-byte sequences.\n        confidence = 0;\n        if (hasBOM && numInvalid==0) {\n            confidence = 100;\n        } else if (hasBOM && numValid > numInvalid*10) {\n            confidence = 80;\n        } else if (numValid > 3 && numInvalid == 0) {\n            confidence = 100;\n        } else if (numValid > 0 && numInvalid == 0) {\n            confidence = 80;\n        } else if (numValid == 0 && numInvalid == 0) {\n            // Plain ASCII. Confidence must be > 10, it's more likely than UTF-16, which\n            //              accepts ASCII with confidence = 10.\n            // TODO: add plain ASCII as an explicitly detected type.\n            confidence = 15;\n        } else if (numValid > numInvalid*10) {\n            // Probably corrupt utf-8 data.  Valid sequences aren't likely by chance.\n            confidence = 25;\n        }\n        return confidence == 0 ? null : new CharsetMatch(det, this, confidence);\n    }\n\n}\n"
  },
  {
    "path": "src/main/java/com/ibm/icu/text/CharsetRecog_Unicode.java",
    "content": "// © 2016 and later: Unicode, Inc. and others.\n// License & terms of use: http://www.unicode.org/copyright.html\n/*\n *******************************************************************************\n * Copyright (C) 1996-2013, International Business Machines Corporation and    *\n * others. All Rights Reserved.                                                *\n *******************************************************************************\n *\n */\n\npackage com.ibm.icu.text;\n\n/**\n * This class matches UTF-16 and UTF-32, both big- and little-endian. The\n * BOM will be used if it is present.\n */\nabstract class CharsetRecog_Unicode extends CharsetRecognizer {\n\n    /* (non-Javadoc)\n     * @see com.ibm.icu.text.CharsetRecognizer#getName()\n     */\n    @Override\n    abstract String getName();\n\n    /* (non-Javadoc)\n     * @see com.ibm.icu.text.CharsetRecognizer#match(com.ibm.icu.text.CharsetDetector)\n     */\n    @Override\n    abstract CharsetMatch match(CharsetDetector det);\n\n    static int codeUnit16FromBytes(byte hi, byte lo) {\n        return ((hi & 0xff) << 8) | (lo & 0xff);\n    }\n\n    // UTF-16 confidence calculation. Very simple minded, but better than nothing.\n    //   Any 8 bit non-control characters bump the confidence up. These have a zero high byte,\n    //     and are very likely to be UTF-16, although they could also be part of a UTF-32 code.\n    //   NULs are a contra-indication, they will appear commonly if the actual encoding is UTF-32.\n    //   NULs should be rare in actual text.\n    static int adjustConfidence(int codeUnit, int confidence) {\n        if (codeUnit == 0) {\n            confidence -= 10;\n        } else if ((codeUnit >= 0x20 && codeUnit <= 0xff) || codeUnit == 0x0a) {\n            confidence += 10;\n        }\n        if (confidence < 0) {\n            confidence = 0;\n        } else if (confidence > 100) {\n            confidence = 100;\n        }\n        return confidence;\n    }\n\n    static class CharsetRecog_UTF_16_BE extends CharsetRecog_Unicode\n    {\n        @Override\n        String getName()\n        {\n            return \"UTF-16BE\";\n        }\n\n        @Override\n        CharsetMatch match(CharsetDetector det)\n        {\n            byte[] input = det.fRawInput;\n            int confidence = 10;\n\n            int bytesToCheck = Math.min(input.length, 30);\n            for (int charIndex=0; charIndex<bytesToCheck-1; charIndex+=2) {\n                int codeUnit = codeUnit16FromBytes(input[charIndex], input[charIndex + 1]);\n                if (charIndex == 0 && codeUnit == 0xFEFF) {\n                    confidence = 100;\n                    break;\n                }\n                confidence = adjustConfidence(codeUnit, confidence);\n                if (confidence == 0 || confidence == 100) {\n                    break;\n                }\n            }\n            if (bytesToCheck < 4 && confidence < 100) {\n                confidence = 0;\n            }\n            if (confidence > 0) {\n                return new CharsetMatch(det, this, confidence);\n            }\n            return null;\n        }\n    }\n\n    static class CharsetRecog_UTF_16_LE extends CharsetRecog_Unicode\n    {\n        @Override\n        String getName()\n        {\n            return \"UTF-16LE\";\n        }\n\n        @Override\n        CharsetMatch match(CharsetDetector det)\n        {\n            byte[] input = det.fRawInput;\n            int confidence = 10;\n\n            int bytesToCheck = Math.min(input.length, 30);\n            for (int charIndex=0; charIndex<bytesToCheck-1; charIndex+=2) {\n                int codeUnit = codeUnit16FromBytes(input[charIndex+1], input[charIndex]);\n                if (charIndex == 0 && codeUnit == 0xFEFF) {\n                    confidence = 100;\n                    break;\n                }\n                confidence = adjustConfidence(codeUnit, confidence);\n                if (confidence == 0 || confidence == 100) {\n                    break;\n                }\n            }\n            if (bytesToCheck < 4 && confidence < 100) {\n                confidence = 0;\n            }\n            if (confidence > 0) {\n                return new CharsetMatch(det, this, confidence);\n            }\n            return null;\n        }\n    }\n\n    static abstract class CharsetRecog_UTF_32 extends CharsetRecog_Unicode\n    {\n        abstract int getChar(byte[] input, int index);\n\n        @Override\n        abstract String getName();\n\n        @Override\n        CharsetMatch match(CharsetDetector det)\n        {\n            byte[] input   = det.fRawInput;\n            int limit      = (det.fRawLength / 4) * 4;\n            int numValid   = 0;\n            int numInvalid = 0;\n            boolean hasBOM = false;\n            int confidence = 0;\n\n            if (limit==0) {\n                return null;\n            }\n            if (getChar(input, 0) == 0x0000FEFF) {\n                hasBOM = true;\n            }\n\n            for(int i = 0; i < limit; i += 4) {\n                int ch = getChar(input, i);\n\n                if (ch < 0 || ch >= 0x10FFFF || (ch >= 0xD800 && ch <= 0xDFFF)) {\n                    numInvalid += 1;\n                } else {\n                    numValid += 1;\n                }\n            }\n\n\n            // Cook up some sort of confidence score, based on presence of a BOM\n            //    and the existence of valid and/or invalid multi-byte sequences.\n            if (hasBOM && numInvalid==0) {\n                confidence = 100;\n            } else if (hasBOM && numValid > numInvalid*10) {\n                confidence = 80;\n            } else if (numValid > 3 && numInvalid == 0) {\n                confidence = 100;\n            } else if (numValid > 0 && numInvalid == 0) {\n                confidence = 80;\n            } else if (numValid > numInvalid*10) {\n                // Probably corrupt UTF-32BE data.  Valid sequences aren't likely by chance.\n                confidence = 25;\n            }\n\n            return confidence == 0 ? null : new CharsetMatch(det, this, confidence);\n        }\n    }\n\n    static class CharsetRecog_UTF_32_BE extends CharsetRecog_UTF_32\n    {\n        @Override\n        int getChar(byte[] input, int index)\n        {\n            return (input[index + 0] & 0xFF) << 24 | (input[index + 1] & 0xFF) << 16 |\n                   (input[index + 2] & 0xFF) <<  8 | (input[index + 3] & 0xFF);\n        }\n\n        @Override\n        String getName()\n        {\n            return \"UTF-32BE\";\n        }\n    }\n\n\n    static class CharsetRecog_UTF_32_LE extends CharsetRecog_UTF_32\n    {\n        @Override\n        int getChar(byte[] input, int index)\n        {\n            return (input[index + 3] & 0xFF) << 24 | (input[index + 2] & 0xFF) << 16 |\n                   (input[index + 1] & 0xFF) <<  8 | (input[index + 0] & 0xFF);\n        }\n\n        @Override\n        String getName()\n        {\n            return \"UTF-32LE\";\n        }\n    }\n}\n"
  },
  {
    "path": "src/main/java/com/ibm/icu/text/CharsetRecog_mbcs.java",
    "content": "// © 2016 and later: Unicode, Inc. and others.\n// License & terms of use: http://www.unicode.org/copyright.html\n/*\n ****************************************************************************\n * Copyright (C) 2005-2012, International Business Machines Corporation and *\n * others. All Rights Reserved.                                             *\n ****************************************************************************\n *\n */\npackage com.ibm.icu.text;\n\nimport java.util.Arrays;\n\n/**\n * CharsetRecognizer implementation for Asian  - double or multi-byte - charsets.\n *                   Match is determined mostly by the input data adhering to the\n *                   encoding scheme for the charset, and, optionally,\n *                   frequency-of-occurrence of characters.\n * <p/>\n *                   Instances of this class are singletons, one per encoding\n *                   being recognized.  They are created in the main\n *                   CharsetDetector class and kept in the global list of available\n *                   encodings to be checked.  The specific encoding being recognized\n *                   is determined by subclass.\n */\nabstract class CharsetRecog_mbcs extends CharsetRecognizer {\n\n   /**\n     * Get the IANA name of this charset.\n     * @return the charset name.\n     */\n    @Override\n    abstract String      getName() ;\n\n\n    /**\n     * Test the match of this charset with the input text data\n     *      which is obtained via the CharsetDetector object.\n     *\n     * @param det  The CharsetDetector, which contains the input text\n     *             to be checked for being in this charset.\n     * @return     Two values packed into one int  (Damn java, anyhow)\n     *             <br/>\n     *             bits 0-7:  the match confidence, ranging from 0-100\n     *             <br/>\n     *             bits 8-15: The match reason, an enum-like value.\n     */\n    int match(CharsetDetector det, int [] commonChars) {\n        @SuppressWarnings(\"unused\")\n        int   singleByteCharCount = 0;  //TODO Do we really need this?\n        int   doubleByteCharCount = 0;\n        int   commonCharCount     = 0;\n        int   badCharCount        = 0;\n        int   totalCharCount      = 0;\n        int   confidence          = 0;\n        iteratedChar   iter       = new iteratedChar();\n\n        detectBlock: {\n            for (iter.reset(); nextChar(iter, det);) {\n                totalCharCount++;\n                if (iter.error) {\n                    badCharCount++;\n                } else {\n                    long cv = iter.charValue & 0xFFFFFFFFL;\n\n                    if (cv <= 0xff) {\n                        singleByteCharCount++;\n                    } else {\n                        doubleByteCharCount++;\n                        if (commonChars != null) {\n                            // NOTE: This assumes that there are no 4-byte common chars.\n                            if (Arrays.binarySearch(commonChars, (int) cv) >= 0) {\n                                commonCharCount++;\n                            }\n                        }\n                    }\n                }\n                if (badCharCount >= 2 && badCharCount*5 >= doubleByteCharCount) {\n                    // Bail out early if the byte data is not matching the encoding scheme.\n                    break detectBlock;\n                }\n            }\n\n            if (doubleByteCharCount <= 10 && badCharCount== 0) {\n                // Not many multi-byte chars.\n                if (doubleByteCharCount == 0 && totalCharCount < 10) {\n                    // There weren't any multibyte sequences, and there was a low density of non-ASCII single bytes.\n                    // We don't have enough data to have any confidence.\n                    // Statistical analysis of single byte non-ASCII characters would probably help here.\n                    confidence = 0;\n                }\n                else {\n                    //   ASCII or ISO file?  It's probably not our encoding,\n                    //   but is not incompatible with our encoding, so don't give it a zero.\n                    confidence = 10;\n                }\n\n                break detectBlock;\n            }\n\n            //\n            //  No match if there are too many characters that don't fit the encoding scheme.\n            //    (should we have zero tolerance for these?)\n            //\n            if (doubleByteCharCount < 20*badCharCount) {\n                confidence = 0;\n                break detectBlock;\n            }\n\n            if (commonChars == null) {\n                // We have no statistics on frequently occurring characters.\n                //  Assess confidence purely on having a reasonable number of\n                //  multi-byte characters (the more the better\n                confidence = 30 + doubleByteCharCount - 20*badCharCount;\n                if (confidence > 100) {\n                    confidence = 100;\n                }\n            }else {\n                //\n                // Frequency of occurrence statistics exist.\n                //\n                double maxVal = Math.log((float)doubleByteCharCount / 4);\n                double scaleFactor = 90.0 / maxVal;\n                confidence = (int)(Math.log(commonCharCount+1) * scaleFactor + 10);\n                confidence = Math.min(confidence, 100);\n            }\n        }   // end of detectBlock:\n\n        return confidence;\n    }\n\n     // \"Character\"  iterated character class.\n     //    Recognizers for specific mbcs encodings make their \"characters\" available\n     //    by providing a nextChar() function that fills in an instance of iteratedChar\n     //    with the next char from the input.\n     //    The returned characters are not converted to Unicode, but remain as the raw\n     //    bytes (concatenated into an int) from the codepage data.\n     //\n     //  For Asian charsets, use the raw input rather than the input that has been\n     //   stripped of markup.  Detection only considers multi-byte chars, effectively\n     //   stripping markup anyway, and double byte chars do occur in markup too.\n     //\n     static class iteratedChar {\n         int             charValue = 0;             // 1-4 bytes from the raw input data\n         int             nextIndex = 0;\n         boolean         error     = false;\n         boolean         done      = false;\n\n         void reset() {\n             charValue = 0;\n             nextIndex = 0;\n             error     = false;\n             done      = false;\n         }\n\n         int nextByte(CharsetDetector det) {\n             if (nextIndex >= det.fRawLength) {\n                 done = true;\n                 return -1;\n             }\n             int byteValue = det.fRawInput[nextIndex++] & 0x00ff;\n             return byteValue;\n         }\n     }\n\n     /**\n      * Get the next character (however many bytes it is) from the input data\n      *    Subclasses for specific charset encodings must implement this function\n      *    to get characters according to the rules of their encoding scheme.\n      *\n      *  This function is not a method of class iteratedChar only because\n      *   that would require a lot of extra derived classes, which is awkward.\n      * @param it  The iteratedChar \"struct\" into which the returned char is placed.\n      * @param det The charset detector, which is needed to get at the input byte data\n      *            being iterated over.\n      * @return    True if a character was returned, false at end of input.\n      */\n     abstract boolean nextChar(iteratedChar it, CharsetDetector det);\n\n\n\n\n\n     /**\n      *   Shift-JIS charset recognizer.\n      *\n      */\n     static class CharsetRecog_sjis extends CharsetRecog_mbcs {\n         static int [] commonChars =\n             // TODO:  This set of data comes from the character frequency-\n             //        of-occurrence analysis tool.  The data needs to be moved\n             //        into a resource and loaded from there.\n            {0x8140, 0x8141, 0x8142, 0x8145, 0x815b, 0x8169, 0x816a, 0x8175, 0x8176, 0x82a0,\n             0x82a2, 0x82a4, 0x82a9, 0x82aa, 0x82ab, 0x82ad, 0x82af, 0x82b1, 0x82b3, 0x82b5,\n             0x82b7, 0x82bd, 0x82be, 0x82c1, 0x82c4, 0x82c5, 0x82c6, 0x82c8, 0x82c9, 0x82cc,\n             0x82cd, 0x82dc, 0x82e0, 0x82e7, 0x82e8, 0x82e9, 0x82ea, 0x82f0, 0x82f1, 0x8341,\n             0x8343, 0x834e, 0x834f, 0x8358, 0x835e, 0x8362, 0x8367, 0x8375, 0x8376, 0x8389,\n             0x838a, 0x838b, 0x838d, 0x8393, 0x8e96, 0x93fa, 0x95aa};\n\n         @Override\n        boolean nextChar(iteratedChar it, CharsetDetector det) {\n             it.error = false;\n             int firstByte;\n             firstByte = it.charValue = it.nextByte(det);\n             if (firstByte < 0) {\n                 return false;\n             }\n\n             if (firstByte <= 0x7f || (firstByte>0xa0 && firstByte<=0xdf)) {\n                 return true;\n             }\n\n             int secondByte = it.nextByte(det);\n             if (secondByte < 0)  {\n                 return false;\n             }\n             it.charValue = (firstByte << 8) | secondByte;\n             if (! ((secondByte>=0x40 && secondByte<=0x7f) || (secondByte>=0x80 && secondByte<=0xff))) {\n                 // Illegal second byte value.\n                 it.error = true;\n             }\n             return true;\n         }\n\n         @Override\n        CharsetMatch match(CharsetDetector det) {\n             int confidence = match(det, commonChars);\n             return confidence == 0 ? null : new CharsetMatch(det, this, confidence);\n         }\n\n         @Override\n        String getName() {\n             return \"Shift_JIS\";\n         }\n\n         @Override\n        public String getLanguage()\n         {\n             return \"ja\";\n         }\n\n\n     }\n\n\n     /**\n      *   Big5 charset recognizer.\n      *\n      */\n     static class CharsetRecog_big5 extends CharsetRecog_mbcs {\n         static int [] commonChars =\n             // TODO:  This set of data comes from the character frequency-\n             //        of-occurrence analysis tool.  The data needs to be moved\n             //        into a resource and loaded from there.\n            {0xa140, 0xa141, 0xa142, 0xa143, 0xa147, 0xa149, 0xa175, 0xa176, 0xa440, 0xa446,\n             0xa447, 0xa448, 0xa451, 0xa454, 0xa457, 0xa464, 0xa46a, 0xa46c, 0xa477, 0xa4a3,\n             0xa4a4, 0xa4a7, 0xa4c1, 0xa4ce, 0xa4d1, 0xa4df, 0xa4e8, 0xa4fd, 0xa540, 0xa548,\n             0xa558, 0xa569, 0xa5cd, 0xa5e7, 0xa657, 0xa661, 0xa662, 0xa668, 0xa670, 0xa6a8,\n             0xa6b3, 0xa6b9, 0xa6d3, 0xa6db, 0xa6e6, 0xa6f2, 0xa740, 0xa751, 0xa759, 0xa7da,\n             0xa8a3, 0xa8a5, 0xa8ad, 0xa8d1, 0xa8d3, 0xa8e4, 0xa8fc, 0xa9c0, 0xa9d2, 0xa9f3,\n             0xaa6b, 0xaaba, 0xaabe, 0xaacc, 0xaafc, 0xac47, 0xac4f, 0xacb0, 0xacd2, 0xad59,\n             0xaec9, 0xafe0, 0xb0ea, 0xb16f, 0xb2b3, 0xb2c4, 0xb36f, 0xb44c, 0xb44e, 0xb54c,\n             0xb5a5, 0xb5bd, 0xb5d0, 0xb5d8, 0xb671, 0xb7ed, 0xb867, 0xb944, 0xbad8, 0xbb44,\n             0xbba1, 0xbdd1, 0xc2c4, 0xc3b9, 0xc440, 0xc45f};\n\n         @Override\n        boolean nextChar(iteratedChar it, CharsetDetector det) {\n             it.error = false;\n             int firstByte;\n             firstByte = it.charValue = it.nextByte(det);\n             if (firstByte < 0) {\n                 return false;\n             }\n\n             if (firstByte <= 0x7f || firstByte==0xff) {\n                 // single byte character.\n                 return true;\n             }\n\n             int secondByte = it.nextByte(det);\n             if (secondByte < 0)  {\n                 return false;\n             }\n             it.charValue = (it.charValue << 8) | secondByte;\n\n             if (secondByte < 0x40 ||\n                 secondByte ==0x7f ||\n                 secondByte == 0xff) {\n                     it.error = true;\n             }\n             return true;\n         }\n\n         @Override\n        CharsetMatch match(CharsetDetector det) {\n             int confidence = match(det, commonChars);\n             return confidence == 0 ? null : new CharsetMatch(det, this, confidence);\n         }\n\n         @Override\n        String getName() {\n             return \"Big5\";\n         }\n\n\n         @Override\n        public String getLanguage()\n         {\n             return \"zh\";\n         }\n     }\n\n\n     /**\n      *   EUC charset recognizers.  One abstract class that provides the common function\n      *             for getting the next character according to the EUC encoding scheme,\n      *             and nested derived classes for EUC_KR, EUC_JP, EUC_CN.\n      *\n      */\n     abstract static class CharsetRecog_euc extends CharsetRecog_mbcs {\n\n         /*\n          *  (non-Javadoc)\n          *  Get the next character value for EUC based encodings.\n          *  Character \"value\" is simply the raw bytes that make up the character\n          *     packed into an int.\n          */\n         @Override\n        boolean nextChar(iteratedChar it, CharsetDetector det) {\n             it.error = false;\n             int firstByte  = 0;\n             int secondByte = 0;\n             int thirdByte  = 0;\n             //int fourthByte = 0;\n\n             buildChar: {\n                 firstByte = it.charValue = it.nextByte(det);\n                 if (firstByte < 0) {\n                     // Ran off the end of the input data\n                     it.done = true;\n                     break buildChar;\n                 }\n                 if (firstByte <= 0x8d) {\n                     // single byte char\n                     break buildChar;\n                 }\n\n                 secondByte = it.nextByte(det);\n                 it.charValue = (it.charValue << 8) | secondByte;\n\n                 if (firstByte >= 0xA1 && firstByte <= 0xfe) {\n                     // Two byte Char\n                     if (secondByte < 0xa1) {\n                         it.error = true;\n                     }\n                     break buildChar;\n                 }\n                 if (firstByte == 0x8e) {\n                     // Code Set 2.\n                     //   In EUC-JP, total char size is 2 bytes, only one byte of actual char value.\n                     //   In EUC-TW, total char size is 4 bytes, three bytes contribute to char value.\n                     // We don't know which we've got.\n                     // Treat it like EUC-JP.  If the data really was EUC-TW, the following two\n                     //   bytes will look like a well formed 2 byte char.\n                     if (secondByte < 0xa1) {\n                         it.error = true;\n                     }\n                     break buildChar;\n                 }\n\n                 if (firstByte == 0x8f) {\n                     // Code set 3.\n                     // Three byte total char size, two bytes of actual char value.\n                     thirdByte    = it.nextByte(det);\n                     it.charValue = (it.charValue << 8) | thirdByte;\n                     if (thirdByte < 0xa1) {\n                         it.error = true;\n                     }\n                 }\n              }\n\n             return (it.done == false);\n         }\n\n         /**\n          * The charset recognize for EUC-JP.  A singleton instance of this class\n          *    is created and kept by the public CharsetDetector class\n          */\n         static class CharsetRecog_euc_jp extends CharsetRecog_euc {\n             static int [] commonChars =\n                 // TODO:  This set of data comes from the character frequency-\n                 //        of-occurrence analysis tool.  The data needs to be moved\n                 //        into a resource and loaded from there.\n                {0xa1a1, 0xa1a2, 0xa1a3, 0xa1a6, 0xa1bc, 0xa1ca, 0xa1cb, 0xa1d6, 0xa1d7, 0xa4a2,\n                 0xa4a4, 0xa4a6, 0xa4a8, 0xa4aa, 0xa4ab, 0xa4ac, 0xa4ad, 0xa4af, 0xa4b1, 0xa4b3,\n                 0xa4b5, 0xa4b7, 0xa4b9, 0xa4bb, 0xa4bd, 0xa4bf, 0xa4c0, 0xa4c1, 0xa4c3, 0xa4c4,\n                 0xa4c6, 0xa4c7, 0xa4c8, 0xa4c9, 0xa4ca, 0xa4cb, 0xa4ce, 0xa4cf, 0xa4d0, 0xa4de,\n                 0xa4df, 0xa4e1, 0xa4e2, 0xa4e4, 0xa4e8, 0xa4e9, 0xa4ea, 0xa4eb, 0xa4ec, 0xa4ef,\n                 0xa4f2, 0xa4f3, 0xa5a2, 0xa5a3, 0xa5a4, 0xa5a6, 0xa5a7, 0xa5aa, 0xa5ad, 0xa5af,\n                 0xa5b0, 0xa5b3, 0xa5b5, 0xa5b7, 0xa5b8, 0xa5b9, 0xa5bf, 0xa5c3, 0xa5c6, 0xa5c7,\n                 0xa5c8, 0xa5c9, 0xa5cb, 0xa5d0, 0xa5d5, 0xa5d6, 0xa5d7, 0xa5de, 0xa5e0, 0xa5e1,\n                 0xa5e5, 0xa5e9, 0xa5ea, 0xa5eb, 0xa5ec, 0xa5ed, 0xa5f3, 0xb8a9, 0xb9d4, 0xbaee,\n                 0xbbc8, 0xbef0, 0xbfb7, 0xc4ea, 0xc6fc, 0xc7bd, 0xcab8, 0xcaf3, 0xcbdc, 0xcdd1};\n             @Override\n            String getName() {\n                 return \"EUC-JP\";\n             }\n\n             @Override\n            CharsetMatch match(CharsetDetector det) {\n                 int confidence = match(det, commonChars);\n                 return confidence == 0 ? null : new CharsetMatch(det, this, confidence);\n             }\n\n             @Override\n            public String getLanguage()\n             {\n                 return \"ja\";\n             }\n         }\n\n         /**\n          * The charset recognize for EUC-KR.  A singleton instance of this class\n          *    is created and kept by the public CharsetDetector class\n          */\n         static class CharsetRecog_euc_kr extends CharsetRecog_euc {\n             static int [] commonChars =\n                 // TODO:  This set of data comes from the character frequency-\n                 //        of-occurrence analysis tool.  The data needs to be moved\n                 //        into a resource and loaded from there.\n                {0xb0a1, 0xb0b3, 0xb0c5, 0xb0cd, 0xb0d4, 0xb0e6, 0xb0ed, 0xb0f8, 0xb0fa, 0xb0fc,\n                 0xb1b8, 0xb1b9, 0xb1c7, 0xb1d7, 0xb1e2, 0xb3aa, 0xb3bb, 0xb4c2, 0xb4cf, 0xb4d9,\n                 0xb4eb, 0xb5a5, 0xb5b5, 0xb5bf, 0xb5c7, 0xb5e9, 0xb6f3, 0xb7af, 0xb7c2, 0xb7ce,\n                 0xb8a6, 0xb8ae, 0xb8b6, 0xb8b8, 0xb8bb, 0xb8e9, 0xb9ab, 0xb9ae, 0xb9cc, 0xb9ce,\n                 0xb9fd, 0xbab8, 0xbace, 0xbad0, 0xbaf1, 0xbbe7, 0xbbf3, 0xbbfd, 0xbcad, 0xbcba,\n                 0xbcd2, 0xbcf6, 0xbdba, 0xbdc0, 0xbdc3, 0xbdc5, 0xbec6, 0xbec8, 0xbedf, 0xbeee,\n                 0xbef8, 0xbefa, 0xbfa1, 0xbfa9, 0xbfc0, 0xbfe4, 0xbfeb, 0xbfec, 0xbff8, 0xc0a7,\n                 0xc0af, 0xc0b8, 0xc0ba, 0xc0bb, 0xc0bd, 0xc0c7, 0xc0cc, 0xc0ce, 0xc0cf, 0xc0d6,\n                 0xc0da, 0xc0e5, 0xc0fb, 0xc0fc, 0xc1a4, 0xc1a6, 0xc1b6, 0xc1d6, 0xc1df, 0xc1f6,\n                 0xc1f8, 0xc4a1, 0xc5cd, 0xc6ae, 0xc7cf, 0xc7d1, 0xc7d2, 0xc7d8, 0xc7e5, 0xc8ad};\n\n             @Override\n            String getName() {\n                 return \"EUC-KR\";\n             }\n\n             @Override\n            CharsetMatch match(CharsetDetector det) {\n                 int confidence = match(det, commonChars);\n                 return confidence == 0 ? null : new CharsetMatch(det, this, confidence);\n             }\n\n             @Override\n            public String getLanguage()\n             {\n                 return \"ko\";\n             }\n         }\n     }\n\n     /**\n      *\n      *   GB-18030 recognizer. Uses simplified Chinese statistics.\n      *\n      */\n     static class CharsetRecog_gb_18030 extends CharsetRecog_mbcs {\n\n         /*\n          *  (non-Javadoc)\n          *  Get the next character value for EUC based encodings.\n          *  Character \"value\" is simply the raw bytes that make up the character\n          *     packed into an int.\n          */\n         @Override\n        boolean nextChar(iteratedChar it, CharsetDetector det) {\n             it.error = false;\n             int firstByte  = 0;\n             int secondByte = 0;\n             int thirdByte  = 0;\n             int fourthByte = 0;\n\n             buildChar: {\n                 firstByte = it.charValue = it.nextByte(det);\n\n                 if (firstByte < 0) {\n                     // Ran off the end of the input data\n                     it.done = true;\n                     break buildChar;\n                 }\n\n                 if (firstByte <= 0x80) {\n                     // single byte char\n                     break buildChar;\n                 }\n\n                 secondByte = it.nextByte(det);\n                 it.charValue = (it.charValue << 8) | secondByte;\n\n                 if (firstByte >= 0x81 && firstByte <= 0xFE) {\n                     // Two byte Char\n                     if ((secondByte >= 0x40 && secondByte <= 0x7E) || (secondByte >=80 && secondByte <=0xFE)) {\n                         break buildChar;\n                     }\n\n                     // Four byte char\n                     if (secondByte >= 0x30 && secondByte <= 0x39) {\n                         thirdByte = it.nextByte(det);\n\n                         if (thirdByte >= 0x81 && thirdByte <= 0xFE) {\n                             fourthByte = it.nextByte(det);\n\n                             if (fourthByte >= 0x30 && fourthByte <= 0x39) {\n                                 it.charValue = (it.charValue << 16) | (thirdByte << 8) | fourthByte;\n                                 break buildChar;\n                             }\n                         }\n                     }\n\n                     it.error = true;\n                     break buildChar;\n                 }\n             }\n\n             return (it.done == false);\n         }\n\n         static int [] commonChars =\n             // TODO:  This set of data comes from the character frequency-\n             //        of-occurrence analysis tool.  The data needs to be moved\n             //        into a resource and loaded from there.\n            {0xa1a1, 0xa1a2, 0xa1a3, 0xa1a4, 0xa1b0, 0xa1b1, 0xa1f1, 0xa1f3, 0xa3a1, 0xa3ac,\n             0xa3ba, 0xb1a8, 0xb1b8, 0xb1be, 0xb2bb, 0xb3c9, 0xb3f6, 0xb4f3, 0xb5bd, 0xb5c4,\n             0xb5e3, 0xb6af, 0xb6d4, 0xb6e0, 0xb7a2, 0xb7a8, 0xb7bd, 0xb7d6, 0xb7dd, 0xb8b4,\n             0xb8df, 0xb8f6, 0xb9ab, 0xb9c9, 0xb9d8, 0xb9fa, 0xb9fd, 0xbacd, 0xbba7, 0xbbd6,\n             0xbbe1, 0xbbfa, 0xbcbc, 0xbcdb, 0xbcfe, 0xbdcc, 0xbecd, 0xbedd, 0xbfb4, 0xbfc6,\n             0xbfc9, 0xc0b4, 0xc0ed, 0xc1cb, 0xc2db, 0xc3c7, 0xc4dc, 0xc4ea, 0xc5cc, 0xc6f7,\n             0xc7f8, 0xc8ab, 0xc8cb, 0xc8d5, 0xc8e7, 0xc9cf, 0xc9fa, 0xcab1, 0xcab5, 0xcac7,\n             0xcad0, 0xcad6, 0xcaf5, 0xcafd, 0xccec, 0xcdf8, 0xceaa, 0xcec4, 0xced2, 0xcee5,\n             0xcfb5, 0xcfc2, 0xcfd6, 0xd0c2, 0xd0c5, 0xd0d0, 0xd0d4, 0xd1a7, 0xd2aa, 0xd2b2,\n             0xd2b5, 0xd2bb, 0xd2d4, 0xd3c3, 0xd3d0, 0xd3fd, 0xd4c2, 0xd4da, 0xd5e2, 0xd6d0};\n\n\n         @Override\n        String getName() {\n             return \"GB18030\";\n         }\n\n         @Override\n        CharsetMatch match(CharsetDetector det) {\n             int confidence = match(det, commonChars);\n             return confidence == 0 ? null : new CharsetMatch(det, this, confidence);\n         }\n\n         @Override\n        public String getLanguage()\n         {\n             return \"zh\";\n         }\n     }\n\n\n}\n"
  },
  {
    "path": "src/main/java/com/ibm/icu/text/CharsetRecog_sbcs.java",
    "content": "// © 2016 and later: Unicode, Inc. and others.\n// License & terms of use: http://www.unicode.org/copyright.html\n/*\n ****************************************************************************\n * Copyright (C) 2005-2013, International Business Machines Corporation and *\n * others. All Rights Reserved.                                             *\n ************************************************************************** *\n *\n */\n\npackage com.ibm.icu.text;\n\n/**\n * This class recognizes single-byte encodings. Because the encoding scheme is so\n * simple, language statistics are used to do the matching.\n */\nabstract class CharsetRecog_sbcs extends CharsetRecognizer {\n\n    /* (non-Javadoc)\n     * @see com.ibm.icu.text.CharsetRecognizer#getName()\n     */\n    @Override\n    abstract String getName();\n\n    static class NGramParser\n    {\n//        private static final int N_GRAM_SIZE = 3;\n        private static final int N_GRAM_MASK = 0xFFFFFF;\n\n        protected int byteIndex = 0;\n        private int ngram = 0;\n\n        private int[] ngramList;\n        protected byte[] byteMap;\n\n        private int ngramCount;\n        private int hitCount;\n\n        protected byte spaceChar;\n\n        public NGramParser(int[] theNgramList, byte[] theByteMap)\n        {\n            ngramList = theNgramList;\n            byteMap   = theByteMap;\n\n            ngram = 0;\n\n            ngramCount = hitCount = 0;\n        }\n\n        /*\n         * Binary search for value in table, which must have exactly 64 entries.\n         */\n        private static int search(int[] table, int value)\n        {\n            int index = 0;\n\n            if (table[index + 32] <= value) {\n                index += 32;\n            }\n\n            if (table[index + 16] <= value) {\n                index += 16;\n            }\n\n            if (table[index + 8] <= value) {\n                index += 8;\n            }\n\n            if (table[index + 4] <= value) {\n                index += 4;\n            }\n\n            if (table[index + 2] <= value) {\n                index += 2;\n            }\n\n            if (table[index + 1] <= value) {\n                index += 1;\n            }\n\n            if (table[index] > value) {\n                index -= 1;\n            }\n\n            if (index < 0 || table[index] != value) {\n                return -1;\n            }\n\n            return index;\n        }\n\n        private void lookup(int thisNgram)\n        {\n            ngramCount += 1;\n\n            if (search(ngramList, thisNgram) >= 0) {\n                hitCount += 1;\n            }\n\n        }\n\n        protected void addByte(int b)\n        {\n            ngram = ((ngram << 8) + (b & 0xFF)) & N_GRAM_MASK;\n            lookup(ngram);\n        }\n\n        private int nextByte(CharsetDetector det)\n        {\n            if (byteIndex >= det.fInputLen) {\n                return -1;\n            }\n\n            return det.fInputBytes[byteIndex++] & 0xFF;\n        }\n\n        protected void parseCharacters(CharsetDetector det)\n        {\n            int b;\n            boolean ignoreSpace = false;\n\n            while ((b = nextByte(det)) >= 0) {\n                byte mb = byteMap[b];\n\n                // TODO: 0x20 might not be a space in all character sets...\n                if (mb != 0) {\n                    if (!(mb == spaceChar && ignoreSpace)) {\n                        addByte(mb);\n                    }\n\n                    ignoreSpace = (mb == spaceChar);\n                }\n            }\n\n        }\n\n        public int parse(CharsetDetector det)\n        {\n            return parse (det, (byte)0x20);\n        }\n        public int parse(CharsetDetector det, byte spaceCh)\n        {\n\n            this.spaceChar = spaceCh;\n\n            parseCharacters(det);\n\n            // TODO: Is this OK? The buffer could have ended in the middle of a word...\n            addByte(spaceChar);\n\n            double rawPercent = (double) hitCount / (double) ngramCount;\n\n//                if (rawPercent <= 2.0) {\n//                    return 0;\n//                }\n\n            // TODO - This is a bit of a hack to take care of a case\n            // were we were getting a confidence of 135...\n            if (rawPercent > 0.33) {\n                return 98;\n            }\n\n            return (int) (rawPercent * 300.0);\n        }\n    }\n\n    static class NGramParser_IBM420 extends NGramParser\n    {\n        private byte alef = 0x00;\n\n        protected static byte[] unshapeMap = {\n/*                 -0           -1           -2           -3           -4           -5           -6           -7           -8           -9           -A           -B           -C           -D           -E           -F   */\n/* 0- */    (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40,\n/* 1- */    (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40,\n/* 2- */    (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40,\n/* 3- */    (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40,\n/* 4- */    (byte) 0x40, (byte) 0x40, (byte) 0x42, (byte) 0x42, (byte) 0x44, (byte) 0x45, (byte) 0x46, (byte) 0x47, (byte) 0x47, (byte) 0x49, (byte) 0x4A, (byte) 0x4B, (byte) 0x4C, (byte) 0x4D, (byte) 0x4E, (byte) 0x4F,\n/* 5- */    (byte) 0x50, (byte) 0x49, (byte) 0x52, (byte) 0x53, (byte) 0x54, (byte) 0x55, (byte) 0x56, (byte) 0x56, (byte) 0x58, (byte) 0x58, (byte) 0x5A, (byte) 0x5B, (byte) 0x5C, (byte) 0x5D, (byte) 0x5E, (byte) 0x5F,\n/* 6- */    (byte) 0x60, (byte) 0x61, (byte) 0x62, (byte) 0x63, (byte) 0x63, (byte) 0x65, (byte) 0x65, (byte) 0x67, (byte) 0x67, (byte) 0x69, (byte) 0x6A, (byte) 0x6B, (byte) 0x6C, (byte) 0x6D, (byte) 0x6E, (byte) 0x6F,\n/* 7- */    (byte) 0x69, (byte) 0x71, (byte) 0x71, (byte) 0x73, (byte) 0x74, (byte) 0x75, (byte) 0x76, (byte) 0x77, (byte) 0x77, (byte) 0x79, (byte) 0x7A, (byte) 0x7B, (byte) 0x7C, (byte) 0x7D, (byte) 0x7E, (byte) 0x7F,\n/* 8- */    (byte) 0x80, (byte) 0x81, (byte) 0x82, (byte) 0x83, (byte) 0x84, (byte) 0x85, (byte) 0x86, (byte) 0x87, (byte) 0x88, (byte) 0x89, (byte) 0x80, (byte) 0x8B, (byte) 0x8B, (byte) 0x8D, (byte) 0x8D, (byte) 0x8F,\n/* 9- */    (byte) 0x90, (byte) 0x91, (byte) 0x92, (byte) 0x93, (byte) 0x94, (byte) 0x95, (byte) 0x96, (byte) 0x97, (byte) 0x98, (byte) 0x99, (byte) 0x9A, (byte) 0x9A, (byte) 0x9A, (byte) 0x9A, (byte) 0x9E, (byte) 0x9E,\n/* A- */    (byte) 0x9E, (byte) 0xA1, (byte) 0xA2, (byte) 0xA3, (byte) 0xA4, (byte) 0xA5, (byte) 0xA6, (byte) 0xA7, (byte) 0xA8, (byte) 0xA9, (byte) 0x9E, (byte) 0xAB, (byte) 0xAB, (byte) 0xAD, (byte) 0xAD, (byte) 0xAF,\n/* B- */    (byte) 0xAF, (byte) 0xB1, (byte) 0xB2, (byte) 0xB3, (byte) 0xB4, (byte) 0xB5, (byte) 0xB6, (byte) 0xB7, (byte) 0xB8, (byte) 0xB9, (byte) 0xB1, (byte) 0xBB, (byte) 0xBB, (byte) 0xBD, (byte) 0xBD, (byte) 0xBF,\n/* C- */    (byte) 0xC0, (byte) 0xC1, (byte) 0xC2, (byte) 0xC3, (byte) 0xC4, (byte) 0xC5, (byte) 0xC6, (byte) 0xC7, (byte) 0xC8, (byte) 0xC9, (byte) 0xCA, (byte) 0xBF, (byte) 0xCC, (byte) 0xBF, (byte) 0xCE, (byte) 0xCF,\n/* D- */    (byte) 0xD0, (byte) 0xD1, (byte) 0xD2, (byte) 0xD3, (byte) 0xD4, (byte) 0xD5, (byte) 0xD6, (byte) 0xD7, (byte) 0xD8, (byte) 0xD9, (byte) 0xDA, (byte) 0xDA, (byte) 0xDC, (byte) 0xDC, (byte) 0xDC, (byte) 0xDF,\n/* E- */    (byte) 0xE0, (byte) 0xE1, (byte) 0xE2, (byte) 0xE3, (byte) 0xE4, (byte) 0xE5, (byte) 0xE6, (byte) 0xE7, (byte) 0xE8, (byte) 0xE9, (byte) 0xEA, (byte) 0xEB, (byte) 0xEC, (byte) 0xED, (byte) 0xEE, (byte) 0xEF,\n/* F- */    (byte) 0xF0, (byte) 0xF1, (byte) 0xF2, (byte) 0xF3, (byte) 0xF4, (byte) 0xF5, (byte) 0xF6, (byte) 0xF7, (byte) 0xF8, (byte) 0xF9, (byte) 0xFA, (byte) 0xFB, (byte) 0xFC, (byte) 0xFD, (byte) 0xFE, (byte) 0xFF,\n        };\n\n\n        public NGramParser_IBM420(int[] theNgramList, byte[] theByteMap)\n        {\n           super(theNgramList, theByteMap);\n        }\n\n        private byte isLamAlef(byte b) {\n             if(b == (byte)0xb2 || b == (byte)0xb3){\n                 return (byte)0x47;\n             }else if(b == (byte)0xb4 || b == (byte)0xb5){\n                 return (byte)0x49;\n             }else if(b == (byte)0xb8 || b == (byte)0xb9){\n                 return (byte)0x56;\n             }else\n                 return (byte)0x00;\n         }\n\n        /*\n         * Arabic shaping needs to be done manually. Cannot call ArabicShaping class\n         * because CharsetDetector is dealing with bytes not Unicode code points. We could\n         * convert the bytes to Unicode code points but that would leave us dependent\n         * on CharsetICU which we try to avoid. IBM420 converter amongst different versions\n         * of JDK can produce different results and therefore is also avoided.\n         */\n         private int nextByte(CharsetDetector det)\n         {\n             if (byteIndex >= det.fInputLen || det.fInputBytes[byteIndex] == 0) {\n                 return -1;\n             }\n            int next;\n\n            alef = isLamAlef(det.fInputBytes[byteIndex]);\n            if(alef != (byte)0x00)\n                next = 0xB1 & 0xFF;\n            else\n                next = unshapeMap[det.fInputBytes[byteIndex]& 0xFF] & 0xFF;\n\n            byteIndex++;\n\n            return next;\n         }\n\n         @Override\n         protected void parseCharacters(CharsetDetector det)\n         {\n             int b;\n             boolean ignoreSpace = false;\n\n             while ((b = nextByte(det)) >= 0) {\n                 byte mb = byteMap[b];\n\n                 // TODO: 0x20 might not be a space in all character sets...\n                 if (mb != 0) {\n                     if (!(mb == spaceChar && ignoreSpace)) {\n                         addByte(mb);\n                     }\n\n                     ignoreSpace = (mb == spaceChar);\n                 }\n                 if(alef != (byte)0x00){\n                     mb = byteMap[alef & 0xFF];\n\n                     // TODO: 0x20 might not be a space in all character sets...\n                     if (mb != 0) {\n                         if (!(mb == spaceChar && ignoreSpace)) {\n                             addByte(mb);\n                         }\n\n                         ignoreSpace = (mb == spaceChar);\n                     }\n\n                 }\n             }\n        }\n    }\n\n\n    int match(CharsetDetector det, int[] ngrams,  byte[] byteMap)\n    {\n        return match (det, ngrams, byteMap, (byte)0x20);\n    }\n\n    int match(CharsetDetector det, int[] ngrams,  byte[] byteMap, byte spaceChar)\n    {\n        NGramParser parser = new NGramParser(ngrams, byteMap);\n        return parser.parse(det, spaceChar);\n    }\n\n    int matchIBM420(CharsetDetector det, int[] ngrams,  byte[] byteMap, byte spaceChar){\n        NGramParser_IBM420 parser = new NGramParser_IBM420(ngrams, byteMap);\n        return parser.parse(det, spaceChar);\n    }\n\n    static class NGramsPlusLang {\n        int[] fNGrams;\n        String  fLang;\n        NGramsPlusLang(String la, int [] ng) {\n            fLang   = la;\n            fNGrams = ng;\n        }\n    }\n\n    static class CharsetRecog_8859_1 extends CharsetRecog_sbcs\n    {\n        protected static byte[] byteMap = {\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x00,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x61, (byte) 0x62, (byte) 0x63, (byte) 0x64, (byte) 0x65, (byte) 0x66, (byte) 0x67,\n            (byte) 0x68, (byte) 0x69, (byte) 0x6A, (byte) 0x6B, (byte) 0x6C, (byte) 0x6D, (byte) 0x6E, (byte) 0x6F,\n            (byte) 0x70, (byte) 0x71, (byte) 0x72, (byte) 0x73, (byte) 0x74, (byte) 0x75, (byte) 0x76, (byte) 0x77,\n            (byte) 0x78, (byte) 0x79, (byte) 0x7A, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x61, (byte) 0x62, (byte) 0x63, (byte) 0x64, (byte) 0x65, (byte) 0x66, (byte) 0x67,\n            (byte) 0x68, (byte) 0x69, (byte) 0x6A, (byte) 0x6B, (byte) 0x6C, (byte) 0x6D, (byte) 0x6E, (byte) 0x6F,\n            (byte) 0x70, (byte) 0x71, (byte) 0x72, (byte) 0x73, (byte) 0x74, (byte) 0x75, (byte) 0x76, (byte) 0x77,\n            (byte) 0x78, (byte) 0x79, (byte) 0x7A, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0xAA, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0xB5, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0xBA, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0xE0, (byte) 0xE1, (byte) 0xE2, (byte) 0xE3, (byte) 0xE4, (byte) 0xE5, (byte) 0xE6, (byte) 0xE7,\n            (byte) 0xE8, (byte) 0xE9, (byte) 0xEA, (byte) 0xEB, (byte) 0xEC, (byte) 0xED, (byte) 0xEE, (byte) 0xEF,\n            (byte) 0xF0, (byte) 0xF1, (byte) 0xF2, (byte) 0xF3, (byte) 0xF4, (byte) 0xF5, (byte) 0xF6, (byte) 0x20,\n            (byte) 0xF8, (byte) 0xF9, (byte) 0xFA, (byte) 0xFB, (byte) 0xFC, (byte) 0xFD, (byte) 0xFE, (byte) 0xDF,\n            (byte) 0xE0, (byte) 0xE1, (byte) 0xE2, (byte) 0xE3, (byte) 0xE4, (byte) 0xE5, (byte) 0xE6, (byte) 0xE7,\n            (byte) 0xE8, (byte) 0xE9, (byte) 0xEA, (byte) 0xEB, (byte) 0xEC, (byte) 0xED, (byte) 0xEE, (byte) 0xEF,\n            (byte) 0xF0, (byte) 0xF1, (byte) 0xF2, (byte) 0xF3, (byte) 0xF4, (byte) 0xF5, (byte) 0xF6, (byte) 0x20,\n            (byte) 0xF8, (byte) 0xF9, (byte) 0xFA, (byte) 0xFB, (byte) 0xFC, (byte) 0xFD, (byte) 0xFE, (byte) 0xFF,\n        };\n\n\n        private static NGramsPlusLang[] ngrams_8859_1 = new NGramsPlusLang[] {\n            new NGramsPlusLang(\n                    \"da\",\n                    new int[] {\n                            0x206166, 0x206174, 0x206465, 0x20656E, 0x206572, 0x20666F, 0x206861, 0x206920, 0x206D65, 0x206F67, 0x2070E5, 0x207369, 0x207374, 0x207469, 0x207669, 0x616620,\n                            0x616E20, 0x616E64, 0x617220, 0x617420, 0x646520, 0x64656E, 0x646572, 0x646574, 0x652073, 0x656420, 0x656465, 0x656E20, 0x656E64, 0x657220, 0x657265, 0x657320,\n                            0x657420, 0x666F72, 0x676520, 0x67656E, 0x676572, 0x696765, 0x696C20, 0x696E67, 0x6B6520, 0x6B6B65, 0x6C6572, 0x6C6967, 0x6C6C65, 0x6D6564, 0x6E6465, 0x6E6520,\n                            0x6E6720, 0x6E6765, 0x6F6720, 0x6F6D20, 0x6F7220, 0x70E520, 0x722064, 0x722065, 0x722073, 0x726520, 0x737465, 0x742073, 0x746520, 0x746572, 0x74696C, 0x766572,\n                    }),\n            new NGramsPlusLang(\n                    \"de\",\n                    new int[] {\n                            0x20616E, 0x206175, 0x206265, 0x206461, 0x206465, 0x206469, 0x206569, 0x206765, 0x206861, 0x20696E, 0x206D69, 0x207363, 0x207365, 0x20756E, 0x207665, 0x20766F,\n                            0x207765, 0x207A75, 0x626572, 0x636820, 0x636865, 0x636874, 0x646173, 0x64656E, 0x646572, 0x646965, 0x652064, 0x652073, 0x65696E, 0x656974, 0x656E20, 0x657220,\n                            0x657320, 0x67656E, 0x68656E, 0x687420, 0x696368, 0x696520, 0x696E20, 0x696E65, 0x697420, 0x6C6963, 0x6C6C65, 0x6E2061, 0x6E2064, 0x6E2073, 0x6E6420, 0x6E6465,\n                            0x6E6520, 0x6E6720, 0x6E6765, 0x6E7465, 0x722064, 0x726465, 0x726569, 0x736368, 0x737465, 0x742064, 0x746520, 0x74656E, 0x746572, 0x756E64, 0x756E67, 0x766572,\n                    }),\n            new NGramsPlusLang(\n                    \"en\",\n                    new int[] {\n                            0x206120, 0x20616E, 0x206265, 0x20636F, 0x20666F, 0x206861, 0x206865, 0x20696E, 0x206D61, 0x206F66, 0x207072, 0x207265, 0x207361, 0x207374, 0x207468, 0x20746F,\n                            0x207768, 0x616964, 0x616C20, 0x616E20, 0x616E64, 0x617320, 0x617420, 0x617465, 0x617469, 0x642061, 0x642074, 0x652061, 0x652073, 0x652074, 0x656420, 0x656E74,\n                            0x657220, 0x657320, 0x666F72, 0x686174, 0x686520, 0x686572, 0x696420, 0x696E20, 0x696E67, 0x696F6E, 0x697320, 0x6E2061, 0x6E2074, 0x6E6420, 0x6E6720, 0x6E7420,\n                            0x6F6620, 0x6F6E20, 0x6F7220, 0x726520, 0x727320, 0x732061, 0x732074, 0x736169, 0x737420, 0x742074, 0x746572, 0x746861, 0x746865, 0x74696F, 0x746F20, 0x747320,\n                    }),\n\n            new NGramsPlusLang(\n                    \"es\",\n                    new int[] {\n                            0x206120, 0x206361, 0x20636F, 0x206465, 0x20656C, 0x20656E, 0x206573, 0x20696E, 0x206C61, 0x206C6F, 0x207061, 0x20706F, 0x207072, 0x207175, 0x207265, 0x207365,\n                            0x20756E, 0x207920, 0x612063, 0x612064, 0x612065, 0x61206C, 0x612070, 0x616369, 0x61646F, 0x616C20, 0x617220, 0x617320, 0x6369F3, 0x636F6E, 0x646520, 0x64656C,\n                            0x646F20, 0x652064, 0x652065, 0x65206C, 0x656C20, 0x656E20, 0x656E74, 0x657320, 0x657374, 0x69656E, 0x69F36E, 0x6C6120, 0x6C6F73, 0x6E2065, 0x6E7465, 0x6F2064,\n                            0x6F2065, 0x6F6E20, 0x6F7220, 0x6F7320, 0x706172, 0x717565, 0x726120, 0x726573, 0x732064, 0x732065, 0x732070, 0x736520, 0x746520, 0x746F20, 0x756520, 0xF36E20,\n                    }),\n\n            new NGramsPlusLang(\n                    \"fr\",\n                    new int[] {\n                            0x206175, 0x20636F, 0x206461, 0x206465, 0x206475, 0x20656E, 0x206574, 0x206C61, 0x206C65, 0x207061, 0x20706F, 0x207072, 0x207175, 0x207365, 0x20736F, 0x20756E,\n                            0x20E020, 0x616E74, 0x617469, 0x636520, 0x636F6E, 0x646520, 0x646573, 0x647520, 0x652061, 0x652063, 0x652064, 0x652065, 0x65206C, 0x652070, 0x652073, 0x656E20,\n                            0x656E74, 0x657220, 0x657320, 0x657420, 0x657572, 0x696F6E, 0x697320, 0x697420, 0x6C6120, 0x6C6520, 0x6C6573, 0x6D656E, 0x6E2064, 0x6E6520, 0x6E7320, 0x6E7420,\n                            0x6F6E20, 0x6F6E74, 0x6F7572, 0x717565, 0x72206C, 0x726520, 0x732061, 0x732064, 0x732065, 0x73206C, 0x732070, 0x742064, 0x746520, 0x74696F, 0x756520, 0x757220,\n                    }),\n\n            new NGramsPlusLang(\n                    \"it\",\n                    new int[] {\n                            0x20616C, 0x206368, 0x20636F, 0x206465, 0x206469, 0x206520, 0x20696C, 0x20696E, 0x206C61, 0x207065, 0x207072, 0x20756E, 0x612063, 0x612064, 0x612070, 0x612073,\n                            0x61746F, 0x636865, 0x636F6E, 0x64656C, 0x646920, 0x652061, 0x652063, 0x652064, 0x652069, 0x65206C, 0x652070, 0x652073, 0x656C20, 0x656C6C, 0x656E74, 0x657220,\n                            0x686520, 0x692061, 0x692063, 0x692064, 0x692073, 0x696120, 0x696C20, 0x696E20, 0x696F6E, 0x6C6120, 0x6C6520, 0x6C6920, 0x6C6C61, 0x6E6520, 0x6E6920, 0x6E6F20,\n                            0x6E7465, 0x6F2061, 0x6F2064, 0x6F2069, 0x6F2073, 0x6F6E20, 0x6F6E65, 0x706572, 0x726120, 0x726520, 0x736920, 0x746120, 0x746520, 0x746920, 0x746F20, 0x7A696F,\n                    }),\n\n            new NGramsPlusLang(\n                    \"nl\",\n                    new int[] {\n                            0x20616C, 0x206265, 0x206461, 0x206465, 0x206469, 0x206565, 0x20656E, 0x206765, 0x206865, 0x20696E, 0x206D61, 0x206D65, 0x206F70, 0x207465, 0x207661, 0x207665,\n                            0x20766F, 0x207765, 0x207A69, 0x61616E, 0x616172, 0x616E20, 0x616E64, 0x617220, 0x617420, 0x636874, 0x646520, 0x64656E, 0x646572, 0x652062, 0x652076, 0x65656E,\n                            0x656572, 0x656E20, 0x657220, 0x657273, 0x657420, 0x67656E, 0x686574, 0x696520, 0x696E20, 0x696E67, 0x697320, 0x6E2062, 0x6E2064, 0x6E2065, 0x6E2068, 0x6E206F,\n                            0x6E2076, 0x6E6465, 0x6E6720, 0x6F6E64, 0x6F6F72, 0x6F7020, 0x6F7220, 0x736368, 0x737465, 0x742064, 0x746520, 0x74656E, 0x746572, 0x76616E, 0x766572, 0x766F6F,\n                    }),\n\n            new NGramsPlusLang(\n                    \"no\",\n                    new int[] {\n                            0x206174, 0x206176, 0x206465, 0x20656E, 0x206572, 0x20666F, 0x206861, 0x206920, 0x206D65, 0x206F67, 0x2070E5, 0x207365, 0x20736B, 0x20736F, 0x207374, 0x207469,\n                            0x207669, 0x20E520, 0x616E64, 0x617220, 0x617420, 0x646520, 0x64656E, 0x646574, 0x652073, 0x656420, 0x656E20, 0x656E65, 0x657220, 0x657265, 0x657420, 0x657474,\n                            0x666F72, 0x67656E, 0x696B6B, 0x696C20, 0x696E67, 0x6B6520, 0x6B6B65, 0x6C6520, 0x6C6C65, 0x6D6564, 0x6D656E, 0x6E2073, 0x6E6520, 0x6E6720, 0x6E6765, 0x6E6E65,\n                            0x6F6720, 0x6F6D20, 0x6F7220, 0x70E520, 0x722073, 0x726520, 0x736F6D, 0x737465, 0x742073, 0x746520, 0x74656E, 0x746572, 0x74696C, 0x747420, 0x747465, 0x766572,\n                    }),\n\n            new NGramsPlusLang(\n                    \"pt\",\n                    new int[] {\n                            0x206120, 0x20636F, 0x206461, 0x206465, 0x20646F, 0x206520, 0x206573, 0x206D61, 0x206E6F, 0x206F20, 0x207061, 0x20706F, 0x207072, 0x207175, 0x207265, 0x207365,\n                            0x20756D, 0x612061, 0x612063, 0x612064, 0x612070, 0x616465, 0x61646F, 0x616C20, 0x617220, 0x617261, 0x617320, 0x636F6D, 0x636F6E, 0x646120, 0x646520, 0x646F20,\n                            0x646F73, 0x652061, 0x652064, 0x656D20, 0x656E74, 0x657320, 0x657374, 0x696120, 0x696361, 0x6D656E, 0x6E7465, 0x6E746F, 0x6F2061, 0x6F2063, 0x6F2064, 0x6F2065,\n                            0x6F2070, 0x6F7320, 0x706172, 0x717565, 0x726120, 0x726573, 0x732061, 0x732064, 0x732065, 0x732070, 0x737461, 0x746520, 0x746F20, 0x756520, 0xE36F20, 0xE7E36F,\n\n                    }),\n\n            new NGramsPlusLang(\n                    \"sv\",\n                    new int[] {\n                            0x206174, 0x206176, 0x206465, 0x20656E, 0x2066F6, 0x206861, 0x206920, 0x20696E, 0x206B6F, 0x206D65, 0x206F63, 0x2070E5, 0x20736B, 0x20736F, 0x207374, 0x207469,\n                            0x207661, 0x207669, 0x20E472, 0x616465, 0x616E20, 0x616E64, 0x617220, 0x617474, 0x636820, 0x646520, 0x64656E, 0x646572, 0x646574, 0x656420, 0x656E20, 0x657220,\n                            0x657420, 0x66F672, 0x67656E, 0x696C6C, 0x696E67, 0x6B6120, 0x6C6C20, 0x6D6564, 0x6E2073, 0x6E6120, 0x6E6465, 0x6E6720, 0x6E6765, 0x6E696E, 0x6F6368, 0x6F6D20,\n                            0x6F6E20, 0x70E520, 0x722061, 0x722073, 0x726120, 0x736B61, 0x736F6D, 0x742073, 0x746120, 0x746520, 0x746572, 0x74696C, 0x747420, 0x766172, 0xE47220, 0xF67220,\n                    }),\n\n        };\n\n\n        @Override\n        public CharsetMatch match(CharsetDetector det)\n        {\n            String name = det.fC1Bytes ? \"windows-1252\" : \"ISO-8859-1\";\n            int bestConfidenceSoFar = -1;\n            String lang = null;\n            for (NGramsPlusLang ngl: ngrams_8859_1) {\n                int confidence = match(det, ngl.fNGrams, byteMap);\n                if (confidence > bestConfidenceSoFar) {\n                    bestConfidenceSoFar = confidence;\n                    lang = ngl.fLang;\n                }\n            }\n            return bestConfidenceSoFar <= 0 ? null : new CharsetMatch(det, this, bestConfidenceSoFar, name, lang);\n        }\n\n\n        @Override\n        public String getName()\n        {\n            return \"ISO-8859-1\";\n        }\n    }\n\n\n    static class CharsetRecog_8859_2 extends CharsetRecog_sbcs\n    {\n        protected static byte[] byteMap = {\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x00,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x61, (byte) 0x62, (byte) 0x63, (byte) 0x64, (byte) 0x65, (byte) 0x66, (byte) 0x67,\n            (byte) 0x68, (byte) 0x69, (byte) 0x6A, (byte) 0x6B, (byte) 0x6C, (byte) 0x6D, (byte) 0x6E, (byte) 0x6F,\n            (byte) 0x70, (byte) 0x71, (byte) 0x72, (byte) 0x73, (byte) 0x74, (byte) 0x75, (byte) 0x76, (byte) 0x77,\n            (byte) 0x78, (byte) 0x79, (byte) 0x7A, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x61, (byte) 0x62, (byte) 0x63, (byte) 0x64, (byte) 0x65, (byte) 0x66, (byte) 0x67,\n            (byte) 0x68, (byte) 0x69, (byte) 0x6A, (byte) 0x6B, (byte) 0x6C, (byte) 0x6D, (byte) 0x6E, (byte) 0x6F,\n            (byte) 0x70, (byte) 0x71, (byte) 0x72, (byte) 0x73, (byte) 0x74, (byte) 0x75, (byte) 0x76, (byte) 0x77,\n            (byte) 0x78, (byte) 0x79, (byte) 0x7A, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0xB1, (byte) 0x20, (byte) 0xB3, (byte) 0x20, (byte) 0xB5, (byte) 0xB6, (byte) 0x20,\n            (byte) 0x20, (byte) 0xB9, (byte) 0xBA, (byte) 0xBB, (byte) 0xBC, (byte) 0x20, (byte) 0xBE, (byte) 0xBF,\n            (byte) 0x20, (byte) 0xB1, (byte) 0x20, (byte) 0xB3, (byte) 0x20, (byte) 0xB5, (byte) 0xB6, (byte) 0xB7,\n            (byte) 0x20, (byte) 0xB9, (byte) 0xBA, (byte) 0xBB, (byte) 0xBC, (byte) 0x20, (byte) 0xBE, (byte) 0xBF,\n            (byte) 0xE0, (byte) 0xE1, (byte) 0xE2, (byte) 0xE3, (byte) 0xE4, (byte) 0xE5, (byte) 0xE6, (byte) 0xE7,\n            (byte) 0xE8, (byte) 0xE9, (byte) 0xEA, (byte) 0xEB, (byte) 0xEC, (byte) 0xED, (byte) 0xEE, (byte) 0xEF,\n            (byte) 0xF0, (byte) 0xF1, (byte) 0xF2, (byte) 0xF3, (byte) 0xF4, (byte) 0xF5, (byte) 0xF6, (byte) 0x20,\n            (byte) 0xF8, (byte) 0xF9, (byte) 0xFA, (byte) 0xFB, (byte) 0xFC, (byte) 0xFD, (byte) 0xFE, (byte) 0xDF,\n            (byte) 0xE0, (byte) 0xE1, (byte) 0xE2, (byte) 0xE3, (byte) 0xE4, (byte) 0xE5, (byte) 0xE6, (byte) 0xE7,\n            (byte) 0xE8, (byte) 0xE9, (byte) 0xEA, (byte) 0xEB, (byte) 0xEC, (byte) 0xED, (byte) 0xEE, (byte) 0xEF,\n            (byte) 0xF0, (byte) 0xF1, (byte) 0xF2, (byte) 0xF3, (byte) 0xF4, (byte) 0xF5, (byte) 0xF6, (byte) 0x20,\n            (byte) 0xF8, (byte) 0xF9, (byte) 0xFA, (byte) 0xFB, (byte) 0xFC, (byte) 0xFD, (byte) 0xFE, (byte) 0x20,\n        };\n\n        private static NGramsPlusLang[] ngrams_8859_2 = new NGramsPlusLang[] {\n            new NGramsPlusLang(\n                    \"cs\",\n                    new int[] {\n                            0x206120, 0x206279, 0x20646F, 0x206A65, 0x206E61, 0x206E65, 0x206F20, 0x206F64, 0x20706F, 0x207072, 0x2070F8, 0x20726F, 0x207365, 0x20736F, 0x207374, 0x20746F,\n                            0x207620, 0x207679, 0x207A61, 0x612070, 0x636520, 0x636820, 0x652070, 0x652073, 0x652076, 0x656D20, 0x656EED, 0x686F20, 0x686F64, 0x697374, 0x6A6520, 0x6B7465,\n                            0x6C6520, 0x6C6920, 0x6E6120, 0x6EE920, 0x6EEC20, 0x6EED20, 0x6F2070, 0x6F646E, 0x6F6A69, 0x6F7374, 0x6F7520, 0x6F7661, 0x706F64, 0x706F6A, 0x70726F, 0x70F865,\n                            0x736520, 0x736F75, 0x737461, 0x737469, 0x73746E, 0x746572, 0x746EED, 0x746F20, 0x752070, 0xBE6520, 0xE16EED, 0xE9686F, 0xED2070, 0xED2073, 0xED6D20, 0xF86564,\n                    }),\n            new NGramsPlusLang(\n                    \"hu\",\n                    new int[] {\n                            0x206120, 0x20617A, 0x206265, 0x206567, 0x20656C, 0x206665, 0x206861, 0x20686F, 0x206973, 0x206B65, 0x206B69, 0x206BF6, 0x206C65, 0x206D61, 0x206D65, 0x206D69,\n                            0x206E65, 0x20737A, 0x207465, 0x20E973, 0x612061, 0x61206B, 0x61206D, 0x612073, 0x616B20, 0x616E20, 0x617A20, 0x62616E, 0x62656E, 0x656779, 0x656B20, 0x656C20,\n                            0x656C65, 0x656D20, 0x656E20, 0x657265, 0x657420, 0x657465, 0x657474, 0x677920, 0x686F67, 0x696E74, 0x697320, 0x6B2061, 0x6BF67A, 0x6D6567, 0x6D696E, 0x6E2061,\n                            0x6E616B, 0x6E656B, 0x6E656D, 0x6E7420, 0x6F6779, 0x732061, 0x737A65, 0x737A74, 0x737AE1, 0x73E967, 0x742061, 0x747420, 0x74E173, 0x7A6572, 0xE16E20, 0xE97320,\n                    }),\n            new NGramsPlusLang(\n                    \"pl\",\n                    new int[] {\n                            0x20637A, 0x20646F, 0x206920, 0x206A65, 0x206B6F, 0x206D61, 0x206D69, 0x206E61, 0x206E69, 0x206F64, 0x20706F, 0x207072, 0x207369, 0x207720, 0x207769, 0x207779,\n                            0x207A20, 0x207A61, 0x612070, 0x612077, 0x616E69, 0x636820, 0x637A65, 0x637A79, 0x646F20, 0x647A69, 0x652070, 0x652073, 0x652077, 0x65207A, 0x65676F, 0x656A20,\n                            0x656D20, 0x656E69, 0x676F20, 0x696120, 0x696520, 0x69656A, 0x6B6120, 0x6B6920, 0x6B6965, 0x6D6965, 0x6E6120, 0x6E6961, 0x6E6965, 0x6F2070, 0x6F7761, 0x6F7769,\n                            0x706F6C, 0x707261, 0x70726F, 0x70727A, 0x727A65, 0x727A79, 0x7369EA, 0x736B69, 0x737461, 0x776965, 0x796368, 0x796D20, 0x7A6520, 0x7A6965, 0x7A7920, 0xF37720,\n                    }),\n            new NGramsPlusLang(\n                    \"ro\",\n                    new int[] {\n                            0x206120, 0x206163, 0x206361, 0x206365, 0x20636F, 0x206375, 0x206465, 0x206469, 0x206C61, 0x206D61, 0x207065, 0x207072, 0x207365, 0x2073E3, 0x20756E, 0x20BA69,\n                            0x20EE6E, 0x612063, 0x612064, 0x617265, 0x617420, 0x617465, 0x617520, 0x636172, 0x636F6E, 0x637520, 0x63E320, 0x646520, 0x652061, 0x652063, 0x652064, 0x652070,\n                            0x652073, 0x656120, 0x656920, 0x656C65, 0x656E74, 0x657374, 0x692061, 0x692063, 0x692064, 0x692070, 0x696520, 0x696920, 0x696E20, 0x6C6120, 0x6C6520, 0x6C6F72,\n                            0x6C7569, 0x6E6520, 0x6E7472, 0x6F7220, 0x70656E, 0x726520, 0x726561, 0x727520, 0x73E320, 0x746520, 0x747275, 0x74E320, 0x756920, 0x756C20, 0xBA6920, 0xEE6E20,\n                    })\n        };\n\n        @Override\n        public CharsetMatch match(CharsetDetector det)\n        {\n            String name = det.fC1Bytes ? \"windows-1250\" : \"ISO-8859-2\";\n            int bestConfidenceSoFar = -1;\n            String lang = null;\n            for (NGramsPlusLang ngl: ngrams_8859_2) {\n                int confidence = match(det, ngl.fNGrams, byteMap);\n                if (confidence > bestConfidenceSoFar) {\n                    bestConfidenceSoFar = confidence;\n                    lang = ngl.fLang;\n                }\n            }\n            return bestConfidenceSoFar <= 0 ? null : new CharsetMatch(det, this, bestConfidenceSoFar, name, lang);\n        }\n\n        @Override\n        public String getName()\n        {\n            return \"ISO-8859-2\";\n        }\n\n    }\n\n\n    abstract static class CharsetRecog_8859_5 extends CharsetRecog_sbcs\n    {\n        protected static byte[] byteMap = {\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x00,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x61, (byte) 0x62, (byte) 0x63, (byte) 0x64, (byte) 0x65, (byte) 0x66, (byte) 0x67,\n            (byte) 0x68, (byte) 0x69, (byte) 0x6A, (byte) 0x6B, (byte) 0x6C, (byte) 0x6D, (byte) 0x6E, (byte) 0x6F,\n            (byte) 0x70, (byte) 0x71, (byte) 0x72, (byte) 0x73, (byte) 0x74, (byte) 0x75, (byte) 0x76, (byte) 0x77,\n            (byte) 0x78, (byte) 0x79, (byte) 0x7A, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x61, (byte) 0x62, (byte) 0x63, (byte) 0x64, (byte) 0x65, (byte) 0x66, (byte) 0x67,\n            (byte) 0x68, (byte) 0x69, (byte) 0x6A, (byte) 0x6B, (byte) 0x6C, (byte) 0x6D, (byte) 0x6E, (byte) 0x6F,\n            (byte) 0x70, (byte) 0x71, (byte) 0x72, (byte) 0x73, (byte) 0x74, (byte) 0x75, (byte) 0x76, (byte) 0x77,\n            (byte) 0x78, (byte) 0x79, (byte) 0x7A, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0xF1, (byte) 0xF2, (byte) 0xF3, (byte) 0xF4, (byte) 0xF5, (byte) 0xF6, (byte) 0xF7,\n            (byte) 0xF8, (byte) 0xF9, (byte) 0xFA, (byte) 0xFB, (byte) 0xFC, (byte) 0x20, (byte) 0xFE, (byte) 0xFF,\n            (byte) 0xD0, (byte) 0xD1, (byte) 0xD2, (byte) 0xD3, (byte) 0xD4, (byte) 0xD5, (byte) 0xD6, (byte) 0xD7,\n            (byte) 0xD8, (byte) 0xD9, (byte) 0xDA, (byte) 0xDB, (byte) 0xDC, (byte) 0xDD, (byte) 0xDE, (byte) 0xDF,\n            (byte) 0xE0, (byte) 0xE1, (byte) 0xE2, (byte) 0xE3, (byte) 0xE4, (byte) 0xE5, (byte) 0xE6, (byte) 0xE7,\n            (byte) 0xE8, (byte) 0xE9, (byte) 0xEA, (byte) 0xEB, (byte) 0xEC, (byte) 0xED, (byte) 0xEE, (byte) 0xEF,\n            (byte) 0xD0, (byte) 0xD1, (byte) 0xD2, (byte) 0xD3, (byte) 0xD4, (byte) 0xD5, (byte) 0xD6, (byte) 0xD7,\n            (byte) 0xD8, (byte) 0xD9, (byte) 0xDA, (byte) 0xDB, (byte) 0xDC, (byte) 0xDD, (byte) 0xDE, (byte) 0xDF,\n            (byte) 0xE0, (byte) 0xE1, (byte) 0xE2, (byte) 0xE3, (byte) 0xE4, (byte) 0xE5, (byte) 0xE6, (byte) 0xE7,\n            (byte) 0xE8, (byte) 0xE9, (byte) 0xEA, (byte) 0xEB, (byte) 0xEC, (byte) 0xED, (byte) 0xEE, (byte) 0xEF,\n            (byte) 0x20, (byte) 0xF1, (byte) 0xF2, (byte) 0xF3, (byte) 0xF4, (byte) 0xF5, (byte) 0xF6, (byte) 0xF7,\n            (byte) 0xF8, (byte) 0xF9, (byte) 0xFA, (byte) 0xFB, (byte) 0xFC, (byte) 0x20, (byte) 0xFE, (byte) 0xFF,\n        };\n\n        @Override\n        public String getName()\n        {\n            return \"ISO-8859-5\";\n        }\n    }\n\n    static class CharsetRecog_8859_5_ru extends CharsetRecog_8859_5\n    {\n        private static int[] ngrams = {\n            0x20D220, 0x20D2DE, 0x20D4DE, 0x20D7D0, 0x20D820, 0x20DAD0, 0x20DADE, 0x20DDD0, 0x20DDD5, 0x20DED1, 0x20DFDE, 0x20DFE0, 0x20E0D0, 0x20E1DE, 0x20E1E2, 0x20E2DE,\n            0x20E7E2, 0x20EDE2, 0xD0DDD8, 0xD0E2EC, 0xD3DE20, 0xD5DBEC, 0xD5DDD8, 0xD5E1E2, 0xD5E220, 0xD820DF, 0xD8D520, 0xD8D820, 0xD8EF20, 0xDBD5DD, 0xDBD820, 0xDBECDD,\n            0xDDD020, 0xDDD520, 0xDDD8D5, 0xDDD8EF, 0xDDDE20, 0xDDDED2, 0xDE20D2, 0xDE20DF, 0xDE20E1, 0xDED220, 0xDED2D0, 0xDED3DE, 0xDED920, 0xDEDBEC, 0xDEDC20, 0xDEE1E2,\n            0xDFDEDB, 0xDFE0D5, 0xDFE0D8, 0xDFE0DE, 0xE0D0D2, 0xE0D5D4, 0xE1E2D0, 0xE1E2D2, 0xE1E2D8, 0xE1EF20, 0xE2D5DB, 0xE2DE20, 0xE2DEE0, 0xE2EC20, 0xE7E2DE, 0xEBE520,\n        };\n\n        @Override\n        public String getLanguage()\n        {\n            return \"ru\";\n        }\n\n        @Override\n        public CharsetMatch match(CharsetDetector det)\n        {\n            int confidence = match(det, ngrams, byteMap);\n            return confidence == 0 ? null : new CharsetMatch(det, this, confidence);\n        }\n    }\n\n    abstract static class CharsetRecog_8859_6 extends CharsetRecog_sbcs\n    {\n        protected static byte[] byteMap = {\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x00,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x61, (byte) 0x62, (byte) 0x63, (byte) 0x64, (byte) 0x65, (byte) 0x66, (byte) 0x67,\n            (byte) 0x68, (byte) 0x69, (byte) 0x6A, (byte) 0x6B, (byte) 0x6C, (byte) 0x6D, (byte) 0x6E, (byte) 0x6F,\n            (byte) 0x70, (byte) 0x71, (byte) 0x72, (byte) 0x73, (byte) 0x74, (byte) 0x75, (byte) 0x76, (byte) 0x77,\n            (byte) 0x78, (byte) 0x79, (byte) 0x7A, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x61, (byte) 0x62, (byte) 0x63, (byte) 0x64, (byte) 0x65, (byte) 0x66, (byte) 0x67,\n            (byte) 0x68, (byte) 0x69, (byte) 0x6A, (byte) 0x6B, (byte) 0x6C, (byte) 0x6D, (byte) 0x6E, (byte) 0x6F,\n            (byte) 0x70, (byte) 0x71, (byte) 0x72, (byte) 0x73, (byte) 0x74, (byte) 0x75, (byte) 0x76, (byte) 0x77,\n            (byte) 0x78, (byte) 0x79, (byte) 0x7A, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0xC1, (byte) 0xC2, (byte) 0xC3, (byte) 0xC4, (byte) 0xC5, (byte) 0xC6, (byte) 0xC7,\n            (byte) 0xC8, (byte) 0xC9, (byte) 0xCA, (byte) 0xCB, (byte) 0xCC, (byte) 0xCD, (byte) 0xCE, (byte) 0xCF,\n            (byte) 0xD0, (byte) 0xD1, (byte) 0xD2, (byte) 0xD3, (byte) 0xD4, (byte) 0xD5, (byte) 0xD6, (byte) 0xD7,\n            (byte) 0xD8, (byte) 0xD9, (byte) 0xDA, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0xE0, (byte) 0xE1, (byte) 0xE2, (byte) 0xE3, (byte) 0xE4, (byte) 0xE5, (byte) 0xE6, (byte) 0xE7,\n            (byte) 0xE8, (byte) 0xE9, (byte) 0xEA, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n        };\n\n        @Override\n        public String getName()\n        {\n            return \"ISO-8859-6\";\n        }\n    }\n\n    static class CharsetRecog_8859_6_ar extends CharsetRecog_8859_6\n    {\n        private static int[] ngrams = {\n            0x20C7E4, 0x20C7E6, 0x20C8C7, 0x20D9E4, 0x20E1EA, 0x20E4E4, 0x20E5E6, 0x20E8C7, 0xC720C7, 0xC7C120, 0xC7CA20, 0xC7D120, 0xC7E420, 0xC7E4C3, 0xC7E4C7, 0xC7E4C8,\n            0xC7E4CA, 0xC7E4CC, 0xC7E4CD, 0xC7E4CF, 0xC7E4D3, 0xC7E4D9, 0xC7E4E2, 0xC7E4E5, 0xC7E4E8, 0xC7E4EA, 0xC7E520, 0xC7E620, 0xC7E6CA, 0xC820C7, 0xC920C7, 0xC920E1,\n            0xC920E4, 0xC920E5, 0xC920E8, 0xCA20C7, 0xCF20C7, 0xCFC920, 0xD120C7, 0xD1C920, 0xD320C7, 0xD920C7, 0xD9E4E9, 0xE1EA20, 0xE420C7, 0xE4C920, 0xE4E920, 0xE4EA20,\n            0xE520C7, 0xE5C720, 0xE5C920, 0xE5E620, 0xE620C7, 0xE720C7, 0xE7C720, 0xE8C7E4, 0xE8E620, 0xE920C7, 0xEA20C7, 0xEA20E5, 0xEA20E8, 0xEAC920, 0xEAD120, 0xEAE620,\n        };\n\n        @Override\n        public String getLanguage()\n        {\n            return \"ar\";\n        }\n\n        @Override\n        public CharsetMatch match(CharsetDetector det)\n        {\n            int confidence = match(det, ngrams, byteMap);\n            return confidence == 0 ? null : new CharsetMatch(det, this, confidence);\n        }\n    }\n\n    abstract static class CharsetRecog_8859_7 extends CharsetRecog_sbcs\n    {\n        protected static byte[] byteMap = {\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x00,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x61, (byte) 0x62, (byte) 0x63, (byte) 0x64, (byte) 0x65, (byte) 0x66, (byte) 0x67,\n            (byte) 0x68, (byte) 0x69, (byte) 0x6A, (byte) 0x6B, (byte) 0x6C, (byte) 0x6D, (byte) 0x6E, (byte) 0x6F,\n            (byte) 0x70, (byte) 0x71, (byte) 0x72, (byte) 0x73, (byte) 0x74, (byte) 0x75, (byte) 0x76, (byte) 0x77,\n            (byte) 0x78, (byte) 0x79, (byte) 0x7A, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x61, (byte) 0x62, (byte) 0x63, (byte) 0x64, (byte) 0x65, (byte) 0x66, (byte) 0x67,\n            (byte) 0x68, (byte) 0x69, (byte) 0x6A, (byte) 0x6B, (byte) 0x6C, (byte) 0x6D, (byte) 0x6E, (byte) 0x6F,\n            (byte) 0x70, (byte) 0x71, (byte) 0x72, (byte) 0x73, (byte) 0x74, (byte) 0x75, (byte) 0x76, (byte) 0x77,\n            (byte) 0x78, (byte) 0x79, (byte) 0x7A, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0xA1, (byte) 0xA2, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0xDC, (byte) 0x20,\n            (byte) 0xDD, (byte) 0xDE, (byte) 0xDF, (byte) 0x20, (byte) 0xFC, (byte) 0x20, (byte) 0xFD, (byte) 0xFE,\n            (byte) 0xC0, (byte) 0xE1, (byte) 0xE2, (byte) 0xE3, (byte) 0xE4, (byte) 0xE5, (byte) 0xE6, (byte) 0xE7,\n            (byte) 0xE8, (byte) 0xE9, (byte) 0xEA, (byte) 0xEB, (byte) 0xEC, (byte) 0xED, (byte) 0xEE, (byte) 0xEF,\n            (byte) 0xF0, (byte) 0xF1, (byte) 0x20, (byte) 0xF3, (byte) 0xF4, (byte) 0xF5, (byte) 0xF6, (byte) 0xF7,\n            (byte) 0xF8, (byte) 0xF9, (byte) 0xFA, (byte) 0xFB, (byte) 0xDC, (byte) 0xDD, (byte) 0xDE, (byte) 0xDF,\n            (byte) 0xE0, (byte) 0xE1, (byte) 0xE2, (byte) 0xE3, (byte) 0xE4, (byte) 0xE5, (byte) 0xE6, (byte) 0xE7,\n            (byte) 0xE8, (byte) 0xE9, (byte) 0xEA, (byte) 0xEB, (byte) 0xEC, (byte) 0xED, (byte) 0xEE, (byte) 0xEF,\n            (byte) 0xF0, (byte) 0xF1, (byte) 0xF2, (byte) 0xF3, (byte) 0xF4, (byte) 0xF5, (byte) 0xF6, (byte) 0xF7,\n            (byte) 0xF8, (byte) 0xF9, (byte) 0xFA, (byte) 0xFB, (byte) 0xFC, (byte) 0xFD, (byte) 0xFE, (byte) 0x20,\n        };\n\n        @Override\n        public String getName()\n        {\n            return \"ISO-8859-7\";\n        }\n    }\n\n    static class CharsetRecog_8859_7_el extends CharsetRecog_8859_7\n    {\n        private static int[] ngrams = {\n            0x20E1ED, 0x20E1F0, 0x20E3E9, 0x20E4E9, 0x20E5F0, 0x20E720, 0x20EAE1, 0x20ECE5, 0x20EDE1, 0x20EF20, 0x20F0E1, 0x20F0EF, 0x20F0F1, 0x20F3F4, 0x20F3F5, 0x20F4E7,\n            0x20F4EF, 0xDFE120, 0xE120E1, 0xE120F4, 0xE1E920, 0xE1ED20, 0xE1F0FC, 0xE1F220, 0xE3E9E1, 0xE5E920, 0xE5F220, 0xE720F4, 0xE7ED20, 0xE7F220, 0xE920F4, 0xE9E120,\n            0xE9EADE, 0xE9F220, 0xEAE1E9, 0xEAE1F4, 0xECE520, 0xED20E1, 0xED20E5, 0xED20F0, 0xEDE120, 0xEFF220, 0xEFF520, 0xF0EFF5, 0xF0F1EF, 0xF0FC20, 0xF220E1, 0xF220E5,\n            0xF220EA, 0xF220F0, 0xF220F4, 0xF3E520, 0xF3E720, 0xF3F4EF, 0xF4E120, 0xF4E1E9, 0xF4E7ED, 0xF4E7F2, 0xF4E9EA, 0xF4EF20, 0xF4EFF5, 0xF4F9ED, 0xF9ED20, 0xFEED20,\n        };\n\n        @Override\n        public String getLanguage()\n        {\n            return \"el\";\n        }\n\n        @Override\n        public CharsetMatch match(CharsetDetector det)\n        {\n            String name = det.fC1Bytes ?  \"windows-1253\" : \"ISO-8859-7\";\n            int confidence = match(det, ngrams, byteMap);\n            return confidence == 0 ? null : new CharsetMatch(det, this, confidence, name, \"el\");\n        }\n    }\n\n    abstract static class CharsetRecog_8859_8 extends CharsetRecog_sbcs\n    {\n        protected static byte[] byteMap = {\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x00,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x61, (byte) 0x62, (byte) 0x63, (byte) 0x64, (byte) 0x65, (byte) 0x66, (byte) 0x67,\n            (byte) 0x68, (byte) 0x69, (byte) 0x6A, (byte) 0x6B, (byte) 0x6C, (byte) 0x6D, (byte) 0x6E, (byte) 0x6F,\n            (byte) 0x70, (byte) 0x71, (byte) 0x72, (byte) 0x73, (byte) 0x74, (byte) 0x75, (byte) 0x76, (byte) 0x77,\n            (byte) 0x78, (byte) 0x79, (byte) 0x7A, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x61, (byte) 0x62, (byte) 0x63, (byte) 0x64, (byte) 0x65, (byte) 0x66, (byte) 0x67,\n            (byte) 0x68, (byte) 0x69, (byte) 0x6A, (byte) 0x6B, (byte) 0x6C, (byte) 0x6D, (byte) 0x6E, (byte) 0x6F,\n            (byte) 0x70, (byte) 0x71, (byte) 0x72, (byte) 0x73, (byte) 0x74, (byte) 0x75, (byte) 0x76, (byte) 0x77,\n            (byte) 0x78, (byte) 0x79, (byte) 0x7A, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0xB5, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0xE0, (byte) 0xE1, (byte) 0xE2, (byte) 0xE3, (byte) 0xE4, (byte) 0xE5, (byte) 0xE6, (byte) 0xE7,\n            (byte) 0xE8, (byte) 0xE9, (byte) 0xEA, (byte) 0xEB, (byte) 0xEC, (byte) 0xED, (byte) 0xEE, (byte) 0xEF,\n            (byte) 0xF0, (byte) 0xF1, (byte) 0xF2, (byte) 0xF3, (byte) 0xF4, (byte) 0xF5, (byte) 0xF6, (byte) 0xF7,\n            (byte) 0xF8, (byte) 0xF9, (byte) 0xFA, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n        };\n\n        @Override\n        public String getName()\n        {\n            return \"ISO-8859-8\";\n        }\n    }\n\n    static class CharsetRecog_8859_8_I_he extends CharsetRecog_8859_8\n    {\n        private static int[] ngrams = {\n            0x20E0E5, 0x20E0E7, 0x20E0E9, 0x20E0FA, 0x20E1E9, 0x20E1EE, 0x20E4E0, 0x20E4E5, 0x20E4E9, 0x20E4EE, 0x20E4F2, 0x20E4F9, 0x20E4FA, 0x20ECE0, 0x20ECE4, 0x20EEE0,\n            0x20F2EC, 0x20F9EC, 0xE0FA20, 0xE420E0, 0xE420E1, 0xE420E4, 0xE420EC, 0xE420EE, 0xE420F9, 0xE4E5E0, 0xE5E020, 0xE5ED20, 0xE5EF20, 0xE5F820, 0xE5FA20, 0xE920E4,\n            0xE9E420, 0xE9E5FA, 0xE9E9ED, 0xE9ED20, 0xE9EF20, 0xE9F820, 0xE9FA20, 0xEC20E0, 0xEC20E4, 0xECE020, 0xECE420, 0xED20E0, 0xED20E1, 0xED20E4, 0xED20EC, 0xED20EE,\n            0xED20F9, 0xEEE420, 0xEF20E4, 0xF0E420, 0xF0E920, 0xF0E9ED, 0xF2EC20, 0xF820E4, 0xF8E9ED, 0xF9EC20, 0xFA20E0, 0xFA20E1, 0xFA20E4, 0xFA20EC, 0xFA20EE, 0xFA20F9,\n        };\n\n        @Override\n        public String getName()\n        {\n            return \"ISO-8859-8-I\";\n        }\n\n        @Override\n        public String getLanguage()\n        {\n            return \"he\";\n        }\n\n        @Override\n        public CharsetMatch match(CharsetDetector det)\n        {\n            String name = det.fC1Bytes ? \"windows-1255\" : \"ISO-8859-8-I\";\n            int confidence = match(det, ngrams, byteMap);\n            return confidence == 0 ? null : new CharsetMatch(det, this, confidence, name, \"he\");\n        }\n    }\n\n    static class CharsetRecog_8859_8_he extends CharsetRecog_8859_8\n    {\n        private static int[] ngrams = {\n            0x20E0E5, 0x20E0EC, 0x20E4E9, 0x20E4EC, 0x20E4EE, 0x20E4F0, 0x20E9F0, 0x20ECF2, 0x20ECF9, 0x20EDE5, 0x20EDE9, 0x20EFE5, 0x20EFE9, 0x20F8E5, 0x20F8E9, 0x20FAE0,\n            0x20FAE5, 0x20FAE9, 0xE020E4, 0xE020EC, 0xE020ED, 0xE020FA, 0xE0E420, 0xE0E5E4, 0xE0EC20, 0xE0EE20, 0xE120E4, 0xE120ED, 0xE120FA, 0xE420E4, 0xE420E9, 0xE420EC,\n            0xE420ED, 0xE420EF, 0xE420F8, 0xE420FA, 0xE4EC20, 0xE5E020, 0xE5E420, 0xE7E020, 0xE9E020, 0xE9E120, 0xE9E420, 0xEC20E4, 0xEC20ED, 0xEC20FA, 0xECF220, 0xECF920,\n            0xEDE9E9, 0xEDE9F0, 0xEDE9F8, 0xEE20E4, 0xEE20ED, 0xEE20FA, 0xEEE120, 0xEEE420, 0xF2E420, 0xF920E4, 0xF920ED, 0xF920FA, 0xF9E420, 0xFAE020, 0xFAE420, 0xFAE5E9,\n        };\n\n        @Override\n        public String getLanguage()\n        {\n            return \"he\";\n        }\n\n        @Override\n        public CharsetMatch match(CharsetDetector det)\n        {\n            String name = det.fC1Bytes ? \"windows-1255\" : \"ISO-8859-8\";\n            int confidence = match(det, ngrams, byteMap);\n            return confidence == 0 ? null : new CharsetMatch(det, this, confidence, name, \"he\");\n\n        }\n    }\n\n    abstract static class CharsetRecog_8859_9 extends CharsetRecog_sbcs\n    {\n        protected static byte[] byteMap = {\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x00,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x61, (byte) 0x62, (byte) 0x63, (byte) 0x64, (byte) 0x65, (byte) 0x66, (byte) 0x67,\n            (byte) 0x68, (byte) 0x69, (byte) 0x6A, (byte) 0x6B, (byte) 0x6C, (byte) 0x6D, (byte) 0x6E, (byte) 0x6F,\n            (byte) 0x70, (byte) 0x71, (byte) 0x72, (byte) 0x73, (byte) 0x74, (byte) 0x75, (byte) 0x76, (byte) 0x77,\n            (byte) 0x78, (byte) 0x79, (byte) 0x7A, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x61, (byte) 0x62, (byte) 0x63, (byte) 0x64, (byte) 0x65, (byte) 0x66, (byte) 0x67,\n            (byte) 0x68, (byte) 0x69, (byte) 0x6A, (byte) 0x6B, (byte) 0x6C, (byte) 0x6D, (byte) 0x6E, (byte) 0x6F,\n            (byte) 0x70, (byte) 0x71, (byte) 0x72, (byte) 0x73, (byte) 0x74, (byte) 0x75, (byte) 0x76, (byte) 0x77,\n            (byte) 0x78, (byte) 0x79, (byte) 0x7A, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0xAA, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0xB5, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0xBA, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0xE0, (byte) 0xE1, (byte) 0xE2, (byte) 0xE3, (byte) 0xE4, (byte) 0xE5, (byte) 0xE6, (byte) 0xE7,\n            (byte) 0xE8, (byte) 0xE9, (byte) 0xEA, (byte) 0xEB, (byte) 0xEC, (byte) 0xED, (byte) 0xEE, (byte) 0xEF,\n            (byte) 0xF0, (byte) 0xF1, (byte) 0xF2, (byte) 0xF3, (byte) 0xF4, (byte) 0xF5, (byte) 0xF6, (byte) 0x20,\n            (byte) 0xF8, (byte) 0xF9, (byte) 0xFA, (byte) 0xFB, (byte) 0xFC, (byte) 0x69, (byte) 0xFE, (byte) 0xDF,\n            (byte) 0xE0, (byte) 0xE1, (byte) 0xE2, (byte) 0xE3, (byte) 0xE4, (byte) 0xE5, (byte) 0xE6, (byte) 0xE7,\n            (byte) 0xE8, (byte) 0xE9, (byte) 0xEA, (byte) 0xEB, (byte) 0xEC, (byte) 0xED, (byte) 0xEE, (byte) 0xEF,\n            (byte) 0xF0, (byte) 0xF1, (byte) 0xF2, (byte) 0xF3, (byte) 0xF4, (byte) 0xF5, (byte) 0xF6, (byte) 0x20,\n            (byte) 0xF8, (byte) 0xF9, (byte) 0xFA, (byte) 0xFB, (byte) 0xFC, (byte) 0xFD, (byte) 0xFE, (byte) 0xFF,\n        };\n\n        @Override\n        public String getName()\n        {\n            return \"ISO-8859-9\";\n        }\n    }\n\n    static class CharsetRecog_8859_9_tr extends CharsetRecog_8859_9\n    {\n        private static int[] ngrams = {\n            0x206261, 0x206269, 0x206275, 0x206461, 0x206465, 0x206765, 0x206861, 0x20696C, 0x206B61, 0x206B6F, 0x206D61, 0x206F6C, 0x207361, 0x207461, 0x207665, 0x207961,\n            0x612062, 0x616B20, 0x616C61, 0x616D61, 0x616E20, 0x616EFD, 0x617220, 0x617261, 0x6172FD, 0x6173FD, 0x617961, 0x626972, 0x646120, 0x646520, 0x646920, 0x652062,\n            0x65206B, 0x656469, 0x656E20, 0x657220, 0x657269, 0x657369, 0x696C65, 0x696E20, 0x696E69, 0x697220, 0x6C616E, 0x6C6172, 0x6C6520, 0x6C6572, 0x6E2061, 0x6E2062,\n            0x6E206B, 0x6E6461, 0x6E6465, 0x6E6520, 0x6E6920, 0x6E696E, 0x6EFD20, 0x72696E, 0x72FD6E, 0x766520, 0x796120, 0x796F72, 0xFD6E20, 0xFD6E64, 0xFD6EFD, 0xFDF0FD,\n        };\n\n        @Override\n        public String getLanguage()\n        {\n            return \"tr\";\n        }\n\n        @Override\n        public CharsetMatch match(CharsetDetector det)\n        {\n            String name = det.fC1Bytes ? \"windows-1254\" : \"ISO-8859-9\";\n            int confidence = match(det, ngrams, byteMap);\n            return confidence == 0 ? null : new CharsetMatch(det, this, confidence, name, \"tr\");\n        }\n    }\n\n    static class CharsetRecog_windows_1251 extends CharsetRecog_sbcs\n    {\n        private static int[] ngrams = {\n            0x20E220, 0x20E2EE, 0x20E4EE, 0x20E7E0, 0x20E820, 0x20EAE0, 0x20EAEE, 0x20EDE0, 0x20EDE5, 0x20EEE1, 0x20EFEE, 0x20EFF0, 0x20F0E0, 0x20F1EE, 0x20F1F2, 0x20F2EE,\n            0x20F7F2, 0x20FDF2, 0xE0EDE8, 0xE0F2FC, 0xE3EE20, 0xE5EBFC, 0xE5EDE8, 0xE5F1F2, 0xE5F220, 0xE820EF, 0xE8E520, 0xE8E820, 0xE8FF20, 0xEBE5ED, 0xEBE820, 0xEBFCED,\n            0xEDE020, 0xEDE520, 0xEDE8E5, 0xEDE8FF, 0xEDEE20, 0xEDEEE2, 0xEE20E2, 0xEE20EF, 0xEE20F1, 0xEEE220, 0xEEE2E0, 0xEEE3EE, 0xEEE920, 0xEEEBFC, 0xEEEC20, 0xEEF1F2,\n            0xEFEEEB, 0xEFF0E5, 0xEFF0E8, 0xEFF0EE, 0xF0E0E2, 0xF0E5E4, 0xF1F2E0, 0xF1F2E2, 0xF1F2E8, 0xF1FF20, 0xF2E5EB, 0xF2EE20, 0xF2EEF0, 0xF2FC20, 0xF7F2EE, 0xFBF520,\n        };\n\n        private static byte[] byteMap = {\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x00,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x61, (byte) 0x62, (byte) 0x63, (byte) 0x64, (byte) 0x65, (byte) 0x66, (byte) 0x67,\n            (byte) 0x68, (byte) 0x69, (byte) 0x6A, (byte) 0x6B, (byte) 0x6C, (byte) 0x6D, (byte) 0x6E, (byte) 0x6F,\n            (byte) 0x70, (byte) 0x71, (byte) 0x72, (byte) 0x73, (byte) 0x74, (byte) 0x75, (byte) 0x76, (byte) 0x77,\n            (byte) 0x78, (byte) 0x79, (byte) 0x7A, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x61, (byte) 0x62, (byte) 0x63, (byte) 0x64, (byte) 0x65, (byte) 0x66, (byte) 0x67,\n            (byte) 0x68, (byte) 0x69, (byte) 0x6A, (byte) 0x6B, (byte) 0x6C, (byte) 0x6D, (byte) 0x6E, (byte) 0x6F,\n            (byte) 0x70, (byte) 0x71, (byte) 0x72, (byte) 0x73, (byte) 0x74, (byte) 0x75, (byte) 0x76, (byte) 0x77,\n            (byte) 0x78, (byte) 0x79, (byte) 0x7A, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x90, (byte) 0x83, (byte) 0x20, (byte) 0x83, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x9A, (byte) 0x20, (byte) 0x9C, (byte) 0x9D, (byte) 0x9E, (byte) 0x9F,\n            (byte) 0x90, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x9A, (byte) 0x20, (byte) 0x9C, (byte) 0x9D, (byte) 0x9E, (byte) 0x9F,\n            (byte) 0x20, (byte) 0xA2, (byte) 0xA2, (byte) 0xBC, (byte) 0x20, (byte) 0xB4, (byte) 0x20, (byte) 0x20,\n            (byte) 0xB8, (byte) 0x20, (byte) 0xBA, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0xBF,\n            (byte) 0x20, (byte) 0x20, (byte) 0xB3, (byte) 0xB3, (byte) 0xB4, (byte) 0xB5, (byte) 0x20, (byte) 0x20,\n            (byte) 0xB8, (byte) 0x20, (byte) 0xBA, (byte) 0x20, (byte) 0xBC, (byte) 0xBE, (byte) 0xBE, (byte) 0xBF,\n            (byte) 0xE0, (byte) 0xE1, (byte) 0xE2, (byte) 0xE3, (byte) 0xE4, (byte) 0xE5, (byte) 0xE6, (byte) 0xE7,\n            (byte) 0xE8, (byte) 0xE9, (byte) 0xEA, (byte) 0xEB, (byte) 0xEC, (byte) 0xED, (byte) 0xEE, (byte) 0xEF,\n            (byte) 0xF0, (byte) 0xF1, (byte) 0xF2, (byte) 0xF3, (byte) 0xF4, (byte) 0xF5, (byte) 0xF6, (byte) 0xF7,\n            (byte) 0xF8, (byte) 0xF9, (byte) 0xFA, (byte) 0xFB, (byte) 0xFC, (byte) 0xFD, (byte) 0xFE, (byte) 0xFF,\n            (byte) 0xE0, (byte) 0xE1, (byte) 0xE2, (byte) 0xE3, (byte) 0xE4, (byte) 0xE5, (byte) 0xE6, (byte) 0xE7,\n            (byte) 0xE8, (byte) 0xE9, (byte) 0xEA, (byte) 0xEB, (byte) 0xEC, (byte) 0xED, (byte) 0xEE, (byte) 0xEF,\n            (byte) 0xF0, (byte) 0xF1, (byte) 0xF2, (byte) 0xF3, (byte) 0xF4, (byte) 0xF5, (byte) 0xF6, (byte) 0xF7,\n            (byte) 0xF8, (byte) 0xF9, (byte) 0xFA, (byte) 0xFB, (byte) 0xFC, (byte) 0xFD, (byte) 0xFE, (byte) 0xFF,\n        };\n\n        @Override\n        public String getName()\n        {\n            return  \"windows-1251\";\n        }\n\n        @Override\n        public String getLanguage()\n        {\n            return \"ru\";\n        }\n\n        @Override\n        public CharsetMatch match(CharsetDetector det)\n        {\n            int confidence = match(det, ngrams, byteMap);\n            return confidence == 0 ? null : new CharsetMatch(det, this, confidence);\n        }\n    }\n\n    static class CharsetRecog_windows_1256 extends CharsetRecog_sbcs\n    {\n        private static int[] ngrams = {\n            0x20C7E1, 0x20C7E4, 0x20C8C7, 0x20DAE1, 0x20DDED, 0x20E1E1, 0x20E3E4, 0x20E6C7, 0xC720C7, 0xC7C120, 0xC7CA20, 0xC7D120, 0xC7E120, 0xC7E1C3, 0xC7E1C7, 0xC7E1C8,\n            0xC7E1CA, 0xC7E1CC, 0xC7E1CD, 0xC7E1CF, 0xC7E1D3, 0xC7E1DA, 0xC7E1DE, 0xC7E1E3, 0xC7E1E6, 0xC7E1ED, 0xC7E320, 0xC7E420, 0xC7E4CA, 0xC820C7, 0xC920C7, 0xC920DD,\n            0xC920E1, 0xC920E3, 0xC920E6, 0xCA20C7, 0xCF20C7, 0xCFC920, 0xD120C7, 0xD1C920, 0xD320C7, 0xDA20C7, 0xDAE1EC, 0xDDED20, 0xE120C7, 0xE1C920, 0xE1EC20, 0xE1ED20,\n            0xE320C7, 0xE3C720, 0xE3C920, 0xE3E420, 0xE420C7, 0xE520C7, 0xE5C720, 0xE6C7E1, 0xE6E420, 0xEC20C7, 0xED20C7, 0xED20E3, 0xED20E6, 0xEDC920, 0xEDD120, 0xEDE420,\n        };\n\n        private static byte[] byteMap = {\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x00,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x61, (byte) 0x62, (byte) 0x63, (byte) 0x64, (byte) 0x65, (byte) 0x66, (byte) 0x67,\n            (byte) 0x68, (byte) 0x69, (byte) 0x6A, (byte) 0x6B, (byte) 0x6C, (byte) 0x6D, (byte) 0x6E, (byte) 0x6F,\n            (byte) 0x70, (byte) 0x71, (byte) 0x72, (byte) 0x73, (byte) 0x74, (byte) 0x75, (byte) 0x76, (byte) 0x77,\n            (byte) 0x78, (byte) 0x79, (byte) 0x7A, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x61, (byte) 0x62, (byte) 0x63, (byte) 0x64, (byte) 0x65, (byte) 0x66, (byte) 0x67,\n            (byte) 0x68, (byte) 0x69, (byte) 0x6A, (byte) 0x6B, (byte) 0x6C, (byte) 0x6D, (byte) 0x6E, (byte) 0x6F,\n            (byte) 0x70, (byte) 0x71, (byte) 0x72, (byte) 0x73, (byte) 0x74, (byte) 0x75, (byte) 0x76, (byte) 0x77,\n            (byte) 0x78, (byte) 0x79, (byte) 0x7A, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x81, (byte) 0x20, (byte) 0x83, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x88, (byte) 0x20, (byte) 0x8A, (byte) 0x20, (byte) 0x9C, (byte) 0x8D, (byte) 0x8E, (byte) 0x8F,\n            (byte) 0x90, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x98, (byte) 0x20, (byte) 0x9A, (byte) 0x20, (byte) 0x9C, (byte) 0x20, (byte) 0x20, (byte) 0x9F,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0xAA, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0xB5, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0xC0, (byte) 0xC1, (byte) 0xC2, (byte) 0xC3, (byte) 0xC4, (byte) 0xC5, (byte) 0xC6, (byte) 0xC7,\n            (byte) 0xC8, (byte) 0xC9, (byte) 0xCA, (byte) 0xCB, (byte) 0xCC, (byte) 0xCD, (byte) 0xCE, (byte) 0xCF,\n            (byte) 0xD0, (byte) 0xD1, (byte) 0xD2, (byte) 0xD3, (byte) 0xD4, (byte) 0xD5, (byte) 0xD6, (byte) 0x20,\n            (byte) 0xD8, (byte) 0xD9, (byte) 0xDA, (byte) 0xDB, (byte) 0xDC, (byte) 0xDD, (byte) 0xDE, (byte) 0xDF,\n            (byte) 0xE0, (byte) 0xE1, (byte) 0xE2, (byte) 0xE3, (byte) 0xE4, (byte) 0xE5, (byte) 0xE6, (byte) 0xE7,\n            (byte) 0xE8, (byte) 0xE9, (byte) 0xEA, (byte) 0xEB, (byte) 0xEC, (byte) 0xED, (byte) 0xEE, (byte) 0xEF,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0xF4, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0xF9, (byte) 0x20, (byte) 0xFB, (byte) 0xFC, (byte) 0x20, (byte) 0x20, (byte) 0xFF,\n        };\n\n        @Override\n        public String getName()\n        {\n            return  \"windows-1256\";\n        }\n\n        @Override\n        public String getLanguage()\n        {\n            return \"ar\";\n        }\n\n        @Override\n        public CharsetMatch match(CharsetDetector det)\n        {\n            int confidence = match(det, ngrams, byteMap);\n            return confidence == 0 ? null : new CharsetMatch(det, this, confidence);\n        }\n    }\n\n    static class CharsetRecog_KOI8_R extends CharsetRecog_sbcs\n    {\n        private static int[] ngrams = {\n            0x20C4CF, 0x20C920, 0x20CBC1, 0x20CBCF, 0x20CEC1, 0x20CEC5, 0x20CFC2, 0x20D0CF, 0x20D0D2, 0x20D2C1, 0x20D3CF, 0x20D3D4, 0x20D4CF, 0x20D720, 0x20D7CF, 0x20DAC1,\n            0x20DCD4, 0x20DED4, 0xC1CEC9, 0xC1D4D8, 0xC5CCD8, 0xC5CEC9, 0xC5D3D4, 0xC5D420, 0xC7CF20, 0xC920D0, 0xC9C520, 0xC9C920, 0xC9D120, 0xCCC5CE, 0xCCC920, 0xCCD8CE,\n            0xCEC120, 0xCEC520, 0xCEC9C5, 0xCEC9D1, 0xCECF20, 0xCECFD7, 0xCF20D0, 0xCF20D3, 0xCF20D7, 0xCFC7CF, 0xCFCA20, 0xCFCCD8, 0xCFCD20, 0xCFD3D4, 0xCFD720, 0xCFD7C1,\n            0xD0CFCC, 0xD0D2C5, 0xD0D2C9, 0xD0D2CF, 0xD2C1D7, 0xD2C5C4, 0xD3D120, 0xD3D4C1, 0xD3D4C9, 0xD3D4D7, 0xD4C5CC, 0xD4CF20, 0xD4CFD2, 0xD4D820, 0xD9C820, 0xDED4CF,\n        };\n\n        private static byte[] byteMap = {\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x00,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x61, (byte) 0x62, (byte) 0x63, (byte) 0x64, (byte) 0x65, (byte) 0x66, (byte) 0x67,\n            (byte) 0x68, (byte) 0x69, (byte) 0x6A, (byte) 0x6B, (byte) 0x6C, (byte) 0x6D, (byte) 0x6E, (byte) 0x6F,\n            (byte) 0x70, (byte) 0x71, (byte) 0x72, (byte) 0x73, (byte) 0x74, (byte) 0x75, (byte) 0x76, (byte) 0x77,\n            (byte) 0x78, (byte) 0x79, (byte) 0x7A, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x61, (byte) 0x62, (byte) 0x63, (byte) 0x64, (byte) 0x65, (byte) 0x66, (byte) 0x67,\n            (byte) 0x68, (byte) 0x69, (byte) 0x6A, (byte) 0x6B, (byte) 0x6C, (byte) 0x6D, (byte) 0x6E, (byte) 0x6F,\n            (byte) 0x70, (byte) 0x71, (byte) 0x72, (byte) 0x73, (byte) 0x74, (byte) 0x75, (byte) 0x76, (byte) 0x77,\n            (byte) 0x78, (byte) 0x79, (byte) 0x7A, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0xA3, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0xA3, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20, (byte) 0x20,\n            (byte) 0xC0, (byte) 0xC1, (byte) 0xC2, (byte) 0xC3, (byte) 0xC4, (byte) 0xC5, (byte) 0xC6, (byte) 0xC7,\n            (byte) 0xC8, (byte) 0xC9, (byte) 0xCA, (byte) 0xCB, (byte) 0xCC, (byte) 0xCD, (byte) 0xCE, (byte) 0xCF,\n            (byte) 0xD0, (byte) 0xD1, (byte) 0xD2, (byte) 0xD3, (byte) 0xD4, (byte) 0xD5, (byte) 0xD6, (byte) 0xD7,\n            (byte) 0xD8, (byte) 0xD9, (byte) 0xDA, (byte) 0xDB, (byte) 0xDC, (byte) 0xDD, (byte) 0xDE, (byte) 0xDF,\n            (byte) 0xC0, (byte) 0xC1, (byte) 0xC2, (byte) 0xC3, (byte) 0xC4, (byte) 0xC5, (byte) 0xC6, (byte) 0xC7,\n            (byte) 0xC8, (byte) 0xC9, (byte) 0xCA, (byte) 0xCB, (byte) 0xCC, (byte) 0xCD, (byte) 0xCE, (byte) 0xCF,\n            (byte) 0xD0, (byte) 0xD1, (byte) 0xD2, (byte) 0xD3, (byte) 0xD4, (byte) 0xD5, (byte) 0xD6, (byte) 0xD7,\n            (byte) 0xD8, (byte) 0xD9, (byte) 0xDA, (byte) 0xDB, (byte) 0xDC, (byte) 0xDD, (byte) 0xDE, (byte) 0xDF,\n        };\n\n        @Override\n        public String getName()\n        {\n            return  \"KOI8-R\";\n        }\n\n        @Override\n        public String getLanguage()\n        {\n            return \"ru\";\n        }\n\n        @Override\n        public CharsetMatch match(CharsetDetector det)\n        {\n            int confidence = match(det, ngrams, byteMap);\n            return confidence == 0 ? null : new CharsetMatch(det, this, confidence);\n        }\n    }\n\n    abstract static class CharsetRecog_IBM424_he extends CharsetRecog_sbcs\n    {\n        protected static byte[] byteMap = {\n/*                 -0           -1           -2           -3           -4           -5           -6           -7           -8           -9           -A           -B           -C           -D           -E           -F   */\n/* 0- */    (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40,\n/* 1- */    (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40,\n/* 2- */    (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40,\n/* 3- */    (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40,\n/* 4- */    (byte) 0x40, (byte) 0x41, (byte) 0x42, (byte) 0x43, (byte) 0x44, (byte) 0x45, (byte) 0x46, (byte) 0x47, (byte) 0x48, (byte) 0x49, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40,\n/* 5- */    (byte) 0x40, (byte) 0x51, (byte) 0x52, (byte) 0x53, (byte) 0x54, (byte) 0x55, (byte) 0x56, (byte) 0x57, (byte) 0x58, (byte) 0x59, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40,\n/* 6- */    (byte) 0x40, (byte) 0x40, (byte) 0x62, (byte) 0x63, (byte) 0x64, (byte) 0x65, (byte) 0x66, (byte) 0x67, (byte) 0x68, (byte) 0x69, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40,\n/* 7- */    (byte) 0x40, (byte) 0x71, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x00, (byte) 0x40, (byte) 0x40,\n/* 8- */    (byte) 0x40, (byte) 0x81, (byte) 0x82, (byte) 0x83, (byte) 0x84, (byte) 0x85, (byte) 0x86, (byte) 0x87, (byte) 0x88, (byte) 0x89, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40,\n/* 9- */    (byte) 0x40, (byte) 0x91, (byte) 0x92, (byte) 0x93, (byte) 0x94, (byte) 0x95, (byte) 0x96, (byte) 0x97, (byte) 0x98, (byte) 0x99, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40,\n/* A- */    (byte) 0xA0, (byte) 0x40, (byte) 0xA2, (byte) 0xA3, (byte) 0xA4, (byte) 0xA5, (byte) 0xA6, (byte) 0xA7, (byte) 0xA8, (byte) 0xA9, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40,\n/* B- */    (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40,\n/* C- */    (byte) 0x40, (byte) 0x81, (byte) 0x82, (byte) 0x83, (byte) 0x84, (byte) 0x85, (byte) 0x86, (byte) 0x87, (byte) 0x88, (byte) 0x89, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40,\n/* D- */    (byte) 0x40, (byte) 0x91, (byte) 0x92, (byte) 0x93, (byte) 0x94, (byte) 0x95, (byte) 0x96, (byte) 0x97, (byte) 0x98, (byte) 0x99, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40,\n/* E- */    (byte) 0x40, (byte) 0x40, (byte) 0xA2, (byte) 0xA3, (byte) 0xA4, (byte) 0xA5, (byte) 0xA6, (byte) 0xA7, (byte) 0xA8, (byte) 0xA9, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40,\n/* F- */    (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40,\n        };\n\n        @Override\n        public String getLanguage()\n        {\n            return \"he\";\n        }\n    }\n    static class CharsetRecog_IBM424_he_rtl extends CharsetRecog_IBM424_he\n    {\n        @Override\n        public String getName()\n        {\n            return \"IBM424_rtl\";\n        }\n        private static int[] ngrams = {\n            0x404146, 0x404148, 0x404151, 0x404171, 0x404251, 0x404256, 0x404541, 0x404546, 0x404551, 0x404556, 0x404562, 0x404569, 0x404571, 0x405441, 0x405445, 0x405641,\n            0x406254, 0x406954, 0x417140, 0x454041, 0x454042, 0x454045, 0x454054, 0x454056, 0x454069, 0x454641, 0x464140, 0x465540, 0x465740, 0x466840, 0x467140, 0x514045,\n            0x514540, 0x514671, 0x515155, 0x515540, 0x515740, 0x516840, 0x517140, 0x544041, 0x544045, 0x544140, 0x544540, 0x554041, 0x554042, 0x554045, 0x554054, 0x554056,\n            0x554069, 0x564540, 0x574045, 0x584540, 0x585140, 0x585155, 0x625440, 0x684045, 0x685155, 0x695440, 0x714041, 0x714042, 0x714045, 0x714054, 0x714056, 0x714069,\n        };\n        @Override\n        public CharsetMatch match(CharsetDetector det)\n        {\n            int confidence = match(det, ngrams, byteMap, (byte)0x40);\n            return confidence == 0 ? null : new CharsetMatch(det, this, confidence);\n        }\n    }\n    static class CharsetRecog_IBM424_he_ltr extends CharsetRecog_IBM424_he\n    {\n        @Override\n        public String getName()\n        {\n            return \"IBM424_ltr\";\n        }\n        private static int[] ngrams = {\n            0x404146, 0x404154, 0x404551, 0x404554, 0x404556, 0x404558, 0x405158, 0x405462, 0x405469, 0x405546, 0x405551, 0x405746, 0x405751, 0x406846, 0x406851, 0x407141,\n            0x407146, 0x407151, 0x414045, 0x414054, 0x414055, 0x414071, 0x414540, 0x414645, 0x415440, 0x415640, 0x424045, 0x424055, 0x424071, 0x454045, 0x454051, 0x454054,\n            0x454055, 0x454057, 0x454068, 0x454071, 0x455440, 0x464140, 0x464540, 0x484140, 0x514140, 0x514240, 0x514540, 0x544045, 0x544055, 0x544071, 0x546240, 0x546940,\n            0x555151, 0x555158, 0x555168, 0x564045, 0x564055, 0x564071, 0x564240, 0x564540, 0x624540, 0x694045, 0x694055, 0x694071, 0x694540, 0x714140, 0x714540, 0x714651\n\n        };\n        @Override\n        public CharsetMatch match(CharsetDetector det)\n        {\n            int confidence = match(det, ngrams, byteMap, (byte)0x40);\n            return confidence == 0 ? null : new CharsetMatch(det, this, confidence);\n        }\n    }\n\n    abstract static class CharsetRecog_IBM420_ar extends CharsetRecog_sbcs\n    {\n\n        protected static byte[] byteMap = {\n/*                 -0           -1           -2           -3           -4           -5           -6           -7           -8           -9           -A           -B           -C           -D           -E           -F   */\n/* 0- */    (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40,\n/* 1- */    (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40,\n/* 2- */    (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40,\n/* 3- */    (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40,\n/* 4- */    (byte) 0x40, (byte) 0x40, (byte) 0x42, (byte) 0x43, (byte) 0x44, (byte) 0x45, (byte) 0x46, (byte) 0x47, (byte) 0x48, (byte) 0x49, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40,\n/* 5- */    (byte) 0x40, (byte) 0x51, (byte) 0x52, (byte) 0x40, (byte) 0x40, (byte) 0x55, (byte) 0x56, (byte) 0x57, (byte) 0x58, (byte) 0x59, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40,\n/* 6- */    (byte) 0x40, (byte) 0x40, (byte) 0x62, (byte) 0x63, (byte) 0x64, (byte) 0x65, (byte) 0x66, (byte) 0x67, (byte) 0x68, (byte) 0x69, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40,\n/* 7- */    (byte) 0x70, (byte) 0x71, (byte) 0x72, (byte) 0x73, (byte) 0x74, (byte) 0x75, (byte) 0x76, (byte) 0x77, (byte) 0x78, (byte) 0x79, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40,\n/* 8- */    (byte) 0x80, (byte) 0x81, (byte) 0x82, (byte) 0x83, (byte) 0x84, (byte) 0x85, (byte) 0x86, (byte) 0x87, (byte) 0x88, (byte) 0x89, (byte) 0x8A, (byte) 0x8B, (byte) 0x8C, (byte) 0x8D, (byte) 0x8E, (byte) 0x8F,\n/* 9- */    (byte) 0x90, (byte) 0x91, (byte) 0x92, (byte) 0x93, (byte) 0x94, (byte) 0x95, (byte) 0x96, (byte) 0x97, (byte) 0x98, (byte) 0x99, (byte) 0x9A, (byte) 0x9B, (byte) 0x9C, (byte) 0x9D, (byte) 0x9E, (byte) 0x9F,\n/* A- */    (byte) 0xA0, (byte) 0x40, (byte) 0xA2, (byte) 0xA3, (byte) 0xA4, (byte) 0xA5, (byte) 0xA6, (byte) 0xA7, (byte) 0xA8, (byte) 0xA9, (byte) 0xAA, (byte) 0xAB, (byte) 0xAC, (byte) 0xAD, (byte) 0xAE, (byte) 0xAF,\n/* B- */    (byte) 0xB0, (byte) 0xB1, (byte) 0xB2, (byte) 0xB3, (byte) 0xB4, (byte) 0xB5, (byte) 0x40, (byte) 0x40, (byte) 0xB8, (byte) 0xB9, (byte) 0xBA, (byte) 0xBB, (byte) 0xBC, (byte) 0xBD, (byte) 0xBE, (byte) 0xBF,\n/* C- */    (byte) 0x40, (byte) 0x81, (byte) 0x82, (byte) 0x83, (byte) 0x84, (byte) 0x85, (byte) 0x86, (byte) 0x87, (byte) 0x88, (byte) 0x89, (byte) 0x40, (byte) 0xCB, (byte) 0x40, (byte) 0xCD, (byte) 0x40, (byte) 0xCF,\n/* D- */    (byte) 0x40, (byte) 0x91, (byte) 0x92, (byte) 0x93, (byte) 0x94, (byte) 0x95, (byte) 0x96, (byte) 0x97, (byte) 0x98, (byte) 0x99, (byte) 0xDA, (byte) 0xDB, (byte) 0xDC, (byte) 0xDD, (byte) 0xDE, (byte) 0xDF,\n/* E- */    (byte) 0x40, (byte) 0x40, (byte) 0xA2, (byte) 0xA3, (byte) 0xA4, (byte) 0xA5, (byte) 0xA6, (byte) 0xA7, (byte) 0xA8, (byte) 0xA9, (byte) 0xEA, (byte) 0xEB, (byte) 0x40, (byte) 0xED, (byte) 0xEE, (byte) 0xEF,\n/* F- */    (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0x40, (byte) 0xFB, (byte) 0xFC, (byte) 0xFD, (byte) 0xFE, (byte) 0x40,\n        };\n\n\n        @Override\n        public String getLanguage()\n        {\n            return \"ar\";\n        }\n\n    }\n    static class CharsetRecog_IBM420_ar_rtl extends CharsetRecog_IBM420_ar\n    {\n        private static int[] ngrams = {\n            0x4056B1, 0x4056BD, 0x405856, 0x409AB1, 0x40ABDC, 0x40B1B1, 0x40BBBD, 0x40CF56, 0x564056, 0x564640, 0x566340, 0x567540, 0x56B140, 0x56B149, 0x56B156, 0x56B158,\n            0x56B163, 0x56B167, 0x56B169, 0x56B173, 0x56B178, 0x56B19A, 0x56B1AD, 0x56B1BB, 0x56B1CF, 0x56B1DC, 0x56BB40, 0x56BD40, 0x56BD63, 0x584056, 0x624056, 0x6240AB,\n            0x6240B1, 0x6240BB, 0x6240CF, 0x634056, 0x734056, 0x736240, 0x754056, 0x756240, 0x784056, 0x9A4056, 0x9AB1DA, 0xABDC40, 0xB14056, 0xB16240, 0xB1DA40, 0xB1DC40,\n            0xBB4056, 0xBB5640, 0xBB6240, 0xBBBD40, 0xBD4056, 0xBF4056, 0xBF5640, 0xCF56B1, 0xCFBD40, 0xDA4056, 0xDC4056, 0xDC40BB, 0xDC40CF, 0xDC6240, 0xDC7540, 0xDCBD40,\n        };\n\n        @Override\n        public String getName()\n        {\n            return \"IBM420_rtl\";\n        }\n        @Override\n        public CharsetMatch match(CharsetDetector det)\n        {\n            int confidence =  matchIBM420(det, ngrams, byteMap, (byte)0x40);\n            return confidence == 0 ? null : new CharsetMatch(det, this, confidence);\n        }\n\n    }\n    static class CharsetRecog_IBM420_ar_ltr extends CharsetRecog_IBM420_ar\n    {\n        private static int[] ngrams = {\n            0x404656, 0x4056BB, 0x4056BF, 0x406273, 0x406275, 0x4062B1, 0x4062BB, 0x4062DC, 0x406356, 0x407556, 0x4075DC, 0x40B156, 0x40BB56, 0x40BD56, 0x40BDBB, 0x40BDCF,\n            0x40BDDC, 0x40DAB1, 0x40DCAB, 0x40DCB1, 0x49B156, 0x564056, 0x564058, 0x564062, 0x564063, 0x564073, 0x564075, 0x564078, 0x56409A, 0x5640B1, 0x5640BB, 0x5640BD,\n            0x5640BF, 0x5640DA, 0x5640DC, 0x565840, 0x56B156, 0x56CF40, 0x58B156, 0x63B156, 0x63BD56, 0x67B156, 0x69B156, 0x73B156, 0x78B156, 0x9AB156, 0xAB4062, 0xADB156,\n            0xB14062, 0xB15640, 0xB156CF, 0xB19A40, 0xB1B140, 0xBB4062, 0xBB40DC, 0xBBB156, 0xBD5640, 0xBDBB40, 0xCF4062, 0xCF40DC, 0xCFB156, 0xDAB19A, 0xDCAB40, 0xDCB156\n        };\n\n        @Override\n        public String getName()\n        {\n            return \"IBM420_ltr\";\n        }\n        @Override\n        public CharsetMatch match(CharsetDetector det)\n        {\n            int confidence = matchIBM420(det, ngrams, byteMap, (byte)0x40);\n            return confidence == 0 ? null : new CharsetMatch(det, this, confidence);\n        }\n\n    }\n}\n"
  },
  {
    "path": "src/main/java/com/ibm/icu/text/CharsetRecognizer.java",
    "content": "// © 2016 and later: Unicode, Inc. and others.\n// License & terms of use: http://www.unicode.org/copyright.html\n/**\n*******************************************************************************\n* Copyright (C) 2005-2012, International Business Machines Corporation and    *\n* others. All Rights Reserved.                                                *\n*******************************************************************************\n*/\npackage com.ibm.icu.text;\n\n/**\n * Abstract class for recognizing a single charset.\n * Part of the implementation of ICU's CharsetDetector.\n * \n * Each specific charset that can be recognized will have an instance\n * of some subclass of this class.  All interaction between the overall\n * CharsetDetector and the stuff specific to an individual charset happens\n * via the interface provided here.\n * \n * Instances of CharsetDetector DO NOT have or maintain \n * state pertaining to a specific match or detect operation.\n * The WILL be shared by multiple instances of CharsetDetector.\n * They encapsulate const charset-specific information.\n */\nabstract class CharsetRecognizer {\n    /**\n     * Get the IANA name of this charset.\n     * @return the charset name.\n     */\n    abstract String      getName();\n    \n    /**\n     * Get the ISO language code for this charset.\n     * @return the language code, or <code>null</code> if the language cannot be determined.\n     */\n    public   String      getLanguage()\n    {\n        return null;\n    }\n    \n    /**\n     * Test the match of this charset with the input text data\n     *      which is obtained via the CharsetDetector object.\n     * \n     * @param det  The CharsetDetector, which contains the input text\n     *             to be checked for being in this charset.\n     * @return     A CharsetMatch object containing details of match\n     *             with this charset, or null if there was no match.\n     */\n    abstract CharsetMatch  match(CharsetDetector det);\n\n}\n"
  },
  {
    "path": "src/main/java/org/billthefarmer/editor/Editor.java",
    "content": "///////////////////////////////////////////////////////////////////////////////\n//\n//  Editor - Text editor for Android\n//\n//  Copyright © 2017  Bill Farmer\n//\n//  This program is free software: you can redistribute it and/or modify\n//  it under the terms of the GNU General Public License as published by\n//  the Free Software Foundation, either version 3 of the License, or\n//  (at your option) any later version.\n//\n//  This program is distributed in the hope that it will be useful,\n//  but WITHOUT ANY WARRANTY; without even the implied warranty of\n//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//  GNU General Public License for more details.\n//\n//  You should have received a copy of the GNU General Public License\n//  along with this program.  If not, see <http://www.gnu.org/licenses/>.\n//\n//  Bill Farmer  william j farmer [at] yahoo [dot] co [dot] uk.\n//\n////////////////////////////////////////////////////////////////////////////////\n\npackage org.billthefarmer.editor;\n\nimport android.Manifest;\nimport android.app.Activity;\nimport android.app.AlertDialog;\nimport android.app.Dialog;\nimport android.content.Context;\nimport android.content.DialogInterface;\nimport android.content.Intent;\nimport android.content.SharedPreferences;\nimport android.content.pm.PackageManager;\nimport android.content.res.Configuration;\nimport android.graphics.Color;\nimport android.graphics.Typeface;\nimport android.net.Uri;\nimport android.os.Build;\nimport android.os.Bundle;\nimport android.os.Environment;\nimport android.preference.PreferenceManager;\nimport android.print.PrintAttributes;\nimport android.print.PrintDocumentAdapter;\nimport android.print.PrintManager;\nimport android.text.Editable;\nimport android.text.Html;\nimport android.text.InputType;\nimport android.text.SpannableStringBuilder;\nimport android.text.Spanned;\nimport android.text.TextPaint;\nimport android.text.TextUtils;\nimport android.text.TextWatcher;\nimport android.text.method.LinkMovementMethod;\nimport android.text.style.BackgroundColorSpan;\nimport android.text.style.ForegroundColorSpan;\nimport android.util.Log;\nimport android.view.ActionMode;\nimport android.view.KeyEvent;\nimport android.view.LayoutInflater;\nimport android.view.Menu;\nimport android.view.MenuInflater;\nimport android.view.MenuItem;\nimport android.view.MotionEvent;\nimport android.view.ScaleGestureDetector;\nimport android.view.SubMenu;\nimport android.view.View;\nimport android.view.ViewGroup;\nimport android.view.ViewTreeObserver;\nimport android.view.inputmethod.EditorInfo;\nimport android.view.inputmethod.InputMethodManager;\nimport android.webkit.WebView;\nimport android.webkit.WebViewClient;\nimport android.widget.Button;\nimport android.widget.EditText;\nimport android.widget.HorizontalScrollView;\nimport android.widget.LinearLayout;\nimport android.widget.ScrollView;\nimport android.widget.SearchView;\nimport android.widget.SeekBar;\nimport android.widget.TextView;\n\nimport android.support.v4.content.FileProvider;\n\nimport com.ibm.icu.text.CharsetDetector;\nimport com.ibm.icu.text.CharsetMatch;\n\nimport org.commonmark.node.*;\nimport org.commonmark.parser.Parser;\nimport org.commonmark.renderer.html.HtmlRenderer;\n\nimport java.io.BufferedInputStream;\nimport java.io.BufferedReader;\nimport java.io.BufferedWriter;\nimport java.io.File;\nimport java.io.FileInputStream;\nimport java.io.FileOutputStream;\nimport java.io.FileReader;\nimport java.io.FileWriter;\nimport java.io.InputStream;\nimport java.io.InputStreamReader;\nimport java.io.OutputStream;\nimport java.io.OutputStreamWriter;\nimport java.io.Reader;\n\nimport java.nio.charset.Charset;\n\nimport java.text.DateFormat;\n\nimport java.util.ArrayList;\nimport java.util.Arrays;\nimport java.util.Collections;\nimport java.util.HashMap;\nimport java.util.Iterator;\nimport java.util.List;\nimport java.util.Locale;\nimport java.util.Map;\nimport java.util.Set;\n\nimport java.util.concurrent.Executors;\nimport java.util.concurrent.ExecutorService;\n\nimport java.util.regex.Matcher;\nimport java.util.regex.Pattern;\n\n@SuppressWarnings(\"deprecation\")\npublic class Editor extends Activity\n{\n    public final static String TAG = \"Editor\";\n\n    public final static String PATH = \"path\";\n    public final static String EDIT = \"edit\";\n    public final static String MATCH = \"match\";\n    public final static String CHANGED = \"changed\";\n    public final static String CONTENT = \"content\";\n    public final static String MODIFIED = \"modified\";\n    public final static String MONOSPACE = \"monospace\";\n\n    public final static String PREF_FILE = \"pref_file\";\n    public final static String PREF_HIGH = \"pref_high\";\n    public final static String PREF_PATHS = \"pref_paths\";\n    public final static String PREF_SAVE = \"pref_save\";\n    public final static String PREF_LAST = \"pref_last\";\n    public final static String PREF_VIEW = \"pref_view\";\n    public final static String PREF_SIZE = \"pref_size\";\n    public final static String PREF_SUGGEST = \"pref_suggest\";\n    public final static String PREF_THEME = \"pref_theme\";\n    public final static String PREF_TYPE = \"pref_type\";\n    public final static String PREF_WRAP = \"pref_wrap\";\n\n    public final static String DOCUMENTS = \"Documents\";\n    public final static String FOLDER = \"Folder\";\n    public final static String UTF_8 = \"UTF-8\";\n\n    public final static String NEW_FILE = \"Untitled.txt\";\n    public final static String EDIT_FILE = \"Editor.txt\";\n    public final static String HTML_FILE = \"Editor.html\";\n\n    public final static String TEXT_HTML = \"text/html\";\n    public final static String TEXT_PLAIN = \"text/plain\";\n    public final static String TEXT_WILD = \"text/*\";\n\n    public final static Pattern PATTERN_CHARS =\n        Pattern.compile(\"[\\\\(\\\\)\\\\[\\\\]\\\\{\\\\}\\\\<\\\\>\\\"'`]\");\n    public final static String BRACKET_CHARS = \"([{<\";\n\n    public final static String HTML_HEAD =\n        \"<!DOCTYPE html>\\n<html>\\n<head>\\n<meta charset=\\\"utf-8\\\">\\n\" +\n        \"<meta name=\\\"viewport\\\" content=\\\"width=device-width, \" +\n        \"initial-scale=1.0\\\">\\n</head>\\n<body>\\n\";\n    public final static String HTML_TAIL = \"\\n</body>\\n</html>\\n\";\n    public final static String FILE_PROVIDER =\n        \"org.billthefarmer.editor.fileprovider\";\n    public final static String OPEN_NEW =\n        \"org.billthefarmer.editor.OPEN_NEW\";\n    public final static String PACKAGE = \"package:\";\n\n    public final static String CC_EXT =\n        \"\\\\.(c(c|pp|xx|\\\\+\\\\+)?|dart|go|h|java|js|kt|m|py|swift|rs)\";\n\n    public final static String HTML_EXT = \"\\\\.html?\";\n\n    public final static String CSS_EXT = \"\\\\.css?\";\n\n    public final static String ORG_EXT = \"\\\\.org\";\n\n    public final static String MD_EXT = \"\\\\.md\";\n\n    public final static String SH_EXT = \"\\\\.sh\";\n\n    // Syntax patterns\n    public final static Pattern KEYWORDS = Pattern.compile\n        (\"\\\\b(abstract|and|arguments|as(m|sert|sociativity|ync)?|await|auto|\" +\n         \"base|break|\" +\n         \"case|catch|chan|char|class|con(st|tinue|venience)|continue|\" +\n         \"covariant|crate|\" +\n         \"de(bugger|f|fault|fer|fered|in|init|l|lete)|didset|do(ne)?|\" +\n         \"dyn(amic)?\" +\n         \"(type)?|el(if|se)|enum|esac|eval|ex(cept|ec|plicit|port|\" +\n         \"tends|tension|tern)|factory|fal(lthrough|se)|fi(nal|nally)?|fn|for|\" +\n         \"friend|from|fun(c(tion)?)?|get|global|go(to)?|hide|if|\" +\n         \"im(pl|plements|port)|in(fix|it|line|out|stanceof|terface|\" +\n         \"ternal)?|is|la(mbda|te|zy)|left|let|library|lo(cal|oop)|ma(p|\" +\n         \"tch)|mut(able|ating)|\" +\n         \"namespace|native|new|nil|none|nonmutating|not|null|of|on|\" +\n         \"operator|optional|or|override|package|part|pass|postfix|\" +\n         \"pre(cedence|fix)|print|private|prot(ected|ocol)|pub(lic)?|\" +\n         \"raise|range|re(f|gister|quired|throw|turn)|right|se(lect|aled|lf)|\" +\n         \"set|show|signed|sizeof|static|strictfp|struct|subscript|super|\" +\n         \"switch|sync(hronized)?|template|th(en|is|rows?)|transient|\" +\n         \"true|try|type(alias|def|id|name|of)?|un(ion|owned|safe|signed)|\" +\n         \"us(e|ing)|va(l|r)|virtual|void|volatile|weak|wh(en|ere|ile)|\" +\n         \"willset|with|yield)\\\\b\", Pattern.MULTILINE);\n\n    public final static Pattern TYPES = Pattern.compile\n        (\"\\\\b(j?bool(ean)?|(u|j)?(byte|char|double|float|int(eger)?|\" +\n         \"long|short))\\\\b\", Pattern.MULTILINE);\n\n    public final static Pattern ANNOTATION =\n        Pattern.compile(\"@\\\\b[A-Za-z]+\\\\b\", Pattern.MULTILINE);\n\n    public final static Pattern CC_COMMENT = Pattern.compile\n        (\"//.*$|(\\\"(?:\\\\\\\\[^\\\"]|\\\\\\\\\\\"|.)*?\\\")|(?s)/\\\\*.*?\\\\*/\",\n         Pattern.MULTILINE);\n\n    public final static Pattern CLASS = Pattern.compile\n        (\"\\\\b[A-Z][A-Za-z0-9_]+\\\\b\", Pattern.MULTILINE);\n\n    public final static Pattern CONSTANT = Pattern.compile\n        (\"\\\\b(([A-Z][A-Z0-9_]+)|(k[A-Z][A-Za-z0-9]+))\\\\b\",\n         Pattern.MULTILINE);\n\n    public final static Pattern OPERATOR = Pattern.compile\n        (\"[+-=:;<>|!%^&*/?]+\", Pattern.MULTILINE);\n\n    public final static Pattern NUMBER = Pattern.compile\n        (\"\\\\b\\\\d+(\\\\.\\\\d*)?(e(\\\\+|\\\\-)?\\\\d+)?\\\\b\",\n         Pattern.MULTILINE);\n\n    public final static Pattern QUOTED = Pattern.compile\n        // \"'([^\\\\\\\\']+|\\\\\\\\([btnfr\\\"'\\\\\\\\]|\" +\n        // \"[0-3]?[0-7]{1,2}|u[0-9a-fA-F]{4}))*'|\" +\n        (\"\\\"([^\\\\\\\\\\\"]+|\\\\\\\\([btnfr\\\"'\\\\\\\\]|\" +\n         \"[0-3]?[0-7]{1,2}|u[0-9a-fA-F]{4}))*\\\"\",\n         Pattern.MULTILINE);\n\n    public final static Pattern HTML_TAGS = Pattern.compile\n        (\"\\\\b(html|base|head|link|meta|style|title|body|address|article|\" +\n         \"aside|footer|header|h\\\\d|hgroup|main|nav|section|blockquote|dd|\" +\n         \"dir|div|dl|dt|figcaption|figure|hr|li|main|ol|p|pre|ul|a|abbr|\" +\n         \"b|bdi|bdo|br|cite|code|data|dfn|em|i|kbd|mark|q|rb|rp|rt|rtc|\" +\n         \"ruby|s|samp|small|span|strong|sub|sup|time|tt|u|var|wbr|area|\" +\n         \"audio|img|map|track|video|applet|embed|iframe|noembed|object|\" +\n         \"param|picture|source|canvas|noscript|script|del|ins|caption|\" +\n         \"col|colgroup|table|tbody|td|tfoot|th|thead|tr|button|datalist|\" +\n         \"fieldset|form|input|label|legend|meter|optgroup|option|output|\" +\n         \"progress|select|textarea|details|dialog|menu|menuitem|summary|\" +\n         \"content|element|shadow|slot|template|acronym|applet|basefont|\" +\n         \"bgsound|big|blink|center|command|content|dir|element|font|\" +\n         \"frame|frameset|image|isindex|keygen|listing|marquee|menuitem|\" +\n         \"multicol|nextid|nobr|noembed|noframes|plaintext|shadow|spacer|\" +\n         \"strike|tt|xmp|doctype)\\\\b\",\n         Pattern.MULTILINE | Pattern.CASE_INSENSITIVE);\n\n    public final static Pattern HTML_ATTRS = Pattern.compile\n        (\"\\\\b(accept|accesskey|action|align|allow|alt|async|\" +\n         \"auto(capitalize|complete|focus|play)|background|\" +\n         \"bgcolor|border|buffered|challenge|charset|checked|cite|\" +\n         \"class|code(base)?|color|cols|colspan|content(\" +\n         \"editable)?|contextmenu|controls|coords|crossorigin|\" +\n         \"csp|data|datetime|decoding|def(ault|er)|dir|dirname|\" +\n         \"disabled|download|draggable|dropzone|enctype|enterkeyhint|\" +\n         \"equiv|for|form(action|novalidate)?|headers|height|\" +\n         \"hidden|high|href(lang)?|http|icon|id|importance|\" +\n         \"inputmode|integrity|intrinsicsize|ismap|itemprop|keytype|\" +\n         \"kind|label|lang|language|list|loading|loop|low|manifest|\" +\n         \"max|maxlength|media|method|min|minlength|multiple|muted|\" +\n         \"name|novalidate|open|optimum|pattern|ping|placeholder|\" +\n         \"poster|preload|property|radiogroup|readonly|referrerpolicy|\" +\n         \"rel|required|reversed|rows|rowspan|sandbox|scope|scoped|\" +\n         \"selected|shape|size|sizes|slot|span|spellcheck|src|srcdoc|\" +\n         \"srclang|srcset|start|step|style|summary|tabindex|target|\" +\n         \"title|translate|type|usemap|value|width|wrap)\\\\b\",\n         Pattern.MULTILINE);\n\n    public final static Pattern HTML_COMMENT =\n        Pattern.compile(\"<!--.*?-->\", Pattern.MULTILINE);\n\n    public final static Pattern CSS_STYLES = Pattern.compile\n        (\"\\\\b(action|active|additive|adjust|after|align|all|alternates|\" +\n         \"animation|annotation|area|areas|as|asian|attachment|attr|\" +\n         \"auto|backdrop|backface|background|basis|before|behavior|\" +\n         \"bezier|bidi|blend|block|blur|border|both|bottom|box|break|\" +\n         \"brightness|calc|caps|caption|caret|cells|center|ch|change|\" +\n         \"character|charset|checked|child|circle|clamp|clear|clip|\" +\n         \"cm|collapse|color|column|columns|combine|composite|conic|\" +\n         \"content|contrast|count|counter|counters|cross|cubic|cue|\" +\n         \"cursor|decoration|default|deg|delay|dir|direction|\" +\n         \"disabled|display|dpcm|dpi|dppx|drop|duration|east|element|\" +\n         \"ellipse|em|emphasis|empty|enabled|end|env|events|ex|face|\" +\n         \"fade|fallback|family|feature|fill|filter|first|fit|flex|\" +\n         \"float|flow|focus|font|format|forms|fr|frames|fullscreen|\" +\n         \"function|gap|grad|gradient|grayscale|grid|grow|hanging|\" +\n         \"height|historical|hover|hsl|hsla|hue|hyphens|hz|image|import|\" +\n         \"in|increment|indent|indeterminate|index|inherit|initial|\" +\n         \"inline|inset|inside|invalid|invert|isolation|items|\" +\n         \"iteration|justify|khz|kerning|keyframes|lang|language|\" +\n         \"last|layout|leader|left|letter|ligatures|line|linear|link|\" +\n         \"list|local|margin|mask|matrix|matrix3d|max|media|min|\" +\n         \"minmax|mix|mm|mode|ms|name|namespace|negative|none|not|nth|\" +\n         \"numeric|object|of|offset|only|opacity|optical|optional|\" +\n         \"order|orientation|origin|ornaments|orphans|out|outline|\" +\n         \"outset|outside|overflow|override|pad|padding|page|path|pc|\" +\n         \"perspective|place|placeholder|play|pointer|polygon|\" +\n         \"position|prefix|property|pt|punctuation|px|q|quotes|rad|\" +\n         \"radial|radius|range|read|rect|relative|rem|rendering|repeat|\" +\n         \"repeating|required|reset|resize|revert|rgb|rgba|right|\" +\n         \"root|rotate|rotate3d|rotatex|rotatey|rotatez|row|rows|\" +\n         \"rule|s|saturate|scale|scale3d|scalex|scaley|scalez|scope|\" +\n         \"scroll|scrollbar|selection|self|sepia|set|settings|shadow|\" +\n         \"shape|shrink|side|size|sizing|skew|skewx|skewy|slice|\" +\n         \"slotted|snap|source|space|spacing|span|speak|src|start|\" +\n         \"state|static|steps|stop|stretch|style|styleset|stylistic|suffix|\" +\n         \"supports|swash|symbols|synthesis|system|tab|table|target|\" +\n         \"template|text|threshold|timing|top|touch|transform|\" +\n         \"transition|translate|translate3d|translatex|translatey|\" +\n         \"translatez|turn|type|underline|unicode|unset|upright|url|\" +\n         \"user|valid|values|var|variant|variation|vertical|vh|\" +\n         \"viewport|visibility|visited|vmax|vmin|vw|weight|white|\" +\n         \"widows|width|will|word|wrap|write|writing|x|y|z|zoom)\\\\b\",\n         Pattern.MULTILINE);\n\n    public final static Pattern CSS_HEX = Pattern.compile\n        (\"#\\\\b[A-Fa-f0-9]+\\\\b\", Pattern.MULTILINE);\n\n    public final static Pattern ORG_HEADER = Pattern.compile\n        (\"(^\\\\*+ +.+$)|(^#\\\\+.+$)\", Pattern.MULTILINE);\n\n    public final static Pattern ORG_LINK = Pattern.compile\n        (\"\\\\[\\\\[.*?\\\\]\\\\]\", Pattern.MULTILINE);\n\n    public final static Pattern ORG_EMPH = Pattern.compile\n        (\"(([*~/+=]+)\\\\b(\\\\w| )+?\\\\b\\\\2)|(\\\\b(_{1,2})(\\\\w| )+?\\\\5\\\\b)\",\n         Pattern.MULTILINE);\n\n    public final static Pattern ORG_COMMENT = Pattern.compile\n        (\"(^# .*$)|(@@.*?@@)\", Pattern.MULTILINE);\n\n    public final static Pattern MD_HEADER = Pattern.compile\n        (\"(^.+\\\\s+-+$)|(^.+\\\\s+=+$)|(^#+ +.+$)\", Pattern.MULTILINE);\n\n    public final static Pattern MD_LINK = Pattern.compile\n        (\"(\\\\!?\\\\[.+\\\\] *\\\\(.+\\\\))|(!?\\\\[.+\\\\] *\\\\[.+\\\\])|\" +\n         \"( *\\\\[.+\\\\]: +.+$)\", Pattern.MULTILINE);\n\n    public final static Pattern MD_EMPH = Pattern.compile\n        (\"(([*~]{1,2})\\\\b(\\\\w| )+?\\\\b\\\\2)|(\\\\b(_{1,2})(\\\\w| )+?\\\\5\\\\b)\",\n         Pattern.MULTILINE);\n\n    public final static Pattern MD_CODE = Pattern.compile\n        (\"(^ {4,}.+$)|(`.+?`)\", Pattern.MULTILINE);\n\n    public final static Pattern SH_VAR = Pattern.compile\n        (\"(\\\\$\\\\b\\\\w+\\\\b)|(\\\\$\\\\{.+?\\\\})|(\\\\$\\\\(.+?\\\\))\", Pattern.MULTILINE);\n\n    public final static Pattern SH_COMMENT = Pattern.compile\n        (\"#.*$\", Pattern.MULTILINE);\n\n    public final static Pattern MODE_PATTERN = Pattern.compile\n        (\"^\\\\S+\\\\s+ed:(.+)$\", Pattern.MULTILINE);\n    public final static Pattern OPTION_PATTERN = Pattern.compile\n        (\"(\\\\s+(no)?(vw|ww|sg|cs|hs|th|ts|tf)(:\\\\w)?)\", Pattern.MULTILINE);\n    public final static Pattern WORD_PATTERN = Pattern.compile\n        (\"\\\\w+\", Pattern.MULTILINE);\n\n    public final static int LAST_SIZE = 256;\n    public final static int MENU_SIZE = 192;\n    public final static int FIRST_SIZE = 256;\n    public final static int TOO_LARGE = 524288;\n    public final static int FOLDER_OFFSET = 0x7d000000;\n    public final static int POSITION_DELAY = 128;\n    public final static int UPDATE_DELAY = 128;\n    public final static int FIND_DELAY = 128;\n    public final static int MAX_PATHS = 10;\n\n    public final static int REQUEST_OPEN = 1;\n\n    public final static int OPEN_DOCUMENT   = 1;\n    public final static int CREATE_DOCUMENT = 2;\n\n    public final static int LIGHT  = 1;\n    public final static int DARK   = 2;\n    public final static int SYSTEM = 3;\n    public final static int WHITE  = 4;\n    public final static int BLACK  = 5;\n    public final static int RETRO  = 6;\n\n    private final static int TINY   = 8;\n    private final static int SMALL  = 12;\n    private final static int MEDIUM = 18;\n    private final static int LARGE  = 24;\n    private final static int HUGE  =  32;\n\n    private final static int NORMAL = 1;\n    private final static int MONO   = 2;\n    private final static int SANS   = 3;\n    private final static int SERIF  = 4;\n\n    private final static int NO_SYNTAX   = 0;\n    private final static int CC_SYNTAX   = 1;\n    private final static int HTML_SYNTAX = 2;\n    private final static int CSS_SYNTAX  = 3;\n    private final static int ORG_SYNTAX  = 4;\n    private final static int MD_SYNTAX   = 5;\n    private final static int SH_SYNTAX   = 6;\n    private final static int DEF_SYNTAX  = 7;\n\n    private Uri uri;\n    private File file;\n    private String path;\n    private Uri content;\n    private String match;\n    private EditText textView;\n    private TextView customView;\n    private MenuItem searchItem;\n    private SearchView searchView;\n    private ScrollView scrollView;\n    private Runnable updateHighlight;\n    private Runnable updateWordCount;\n\n    private ScaleGestureDetector scaleDetector;\n    private QueryTextListener queryTextListener;\n    private ExecutorService executor;\n\n    private Map<String, Integer> pathMap;\n    private List<String> removeList;\n\n    private boolean highlight = false;\n\n    private boolean last = false;\n    private boolean save = false;\n    private boolean edit = false;\n    private boolean view = false;\n\n    private boolean wrap = false;\n    private boolean suggest = true;\n\n    private boolean changed = false;\n\n    private long modified;\n\n    private int theme = LIGHT;\n    private int size = MEDIUM;\n    private int type = MONO;\n\n    private int syntax;\n\n    // onCreate\n    @Override\n    protected void onCreate(Bundle savedInstanceState)\n    {\n        super.onCreate(savedInstanceState);\n\n        SharedPreferences preferences =\n            PreferenceManager.getDefaultSharedPreferences(this);\n\n        String typefaces[] = getResources().getStringArray(R.array.typefaces);\n        List<String> typeList = Arrays.asList(typefaces);\n        int monospace = typeList.indexOf(MONOSPACE);\n\n        save = preferences.getBoolean(PREF_SAVE, false);\n        view = preferences.getBoolean(PREF_VIEW, true);\n        last = preferences.getBoolean(PREF_LAST, false);\n        wrap = preferences.getBoolean(PREF_WRAP, false);\n        suggest = preferences.getBoolean(PREF_SUGGEST, true);\n        highlight = preferences.getBoolean(PREF_HIGH, false);\n\n        theme = preferences.getInt(PREF_THEME, LIGHT);\n        size = preferences.getInt(PREF_SIZE, MEDIUM);\n        type = preferences.getInt(PREF_TYPE, monospace);\n\n        Set<String> pathSet = preferences.getStringSet(PREF_PATHS, null);\n        pathMap = new HashMap<>();\n\n        if (pathSet != null)\n            for (String path : pathSet)\n                pathMap.put(path, preferences.getInt(path, 0));\n\n        removeList = new ArrayList<>();\n\n        Configuration config = getResources().getConfiguration();\n        int night = config.uiMode & Configuration.UI_MODE_NIGHT_MASK;\n\n        switch (theme)\n        {\n        case LIGHT:\n            setTheme(R.style.AppTheme);\n            break;\n\n        case DARK:\n            setTheme(R.style.AppDarkTheme);\n            break;\n\n        case SYSTEM:\n            switch (night)\n            {\n            case Configuration.UI_MODE_NIGHT_NO:\n                setTheme(R.style.AppTheme);\n                break;\n\n            case Configuration.UI_MODE_NIGHT_YES:\n                setTheme(R.style.AppDarkTheme);\n                break;\n            }\n            break;\n\n        case WHITE:\n            setTheme(R.style.AppWhiteTheme);\n            break;\n\n        case BLACK:\n            setTheme(R.style.AppBlackTheme);\n            break;\n\n        case RETRO:\n            setTheme(R.style.AppRetroTheme);\n            break;\n        }\n\n        if (wrap)\n            setContentView(R.layout.wrap);\n\n        else\n            setContentView(R.layout.edit);\n\n        textView = findViewById(R.id.text);\n        scrollView = findViewById(R.id.vscroll);\n\n        getActionBar().setSubtitle(match);\n        getActionBar().setCustomView(R.layout.custom);\n        getActionBar().setDisplayShowCustomEnabled(true);\n        customView = (TextView) getActionBar().getCustomView();\n\n        updateWordCount = () -> wordCountText();\n\n        if (savedInstanceState != null)\n            edit = savedInstanceState.getBoolean(EDIT);\n\n        if (!edit)\n        {\n            textView.setRawInputType(InputType.TYPE_NULL);\n            textView.setTextIsSelectable(true);\n        }\n\n        else if (!suggest)\n            textView.setInputType(InputType.TYPE_CLASS_TEXT |\n                                  InputType.TYPE_TEXT_FLAG_MULTI_LINE |\n                                  InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);\n\n        setSizeAndTypeface(size, type);\n        executor = Executors.newSingleThreadExecutor();\n\n        setListeners();\n\n        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R &&\n            !Environment.isExternalStorageManager())\n        {\n            alertDialog(this, R.string.access, R.string.manageFiles,\n                        R.string.access, R.string.cancel, (dialog, id) ->\n            {\n                switch (id)\n                {\n                case DialogInterface.BUTTON_POSITIVE:\n                    Uri appId = Uri.parse(PACKAGE + BuildConfig.APPLICATION_ID);\n                    Intent intent = new\n                        Intent(android.provider.Settings.\n                               ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION,\n                               appId);\n                    startActivity(intent);\n                    break;\n\n                case DialogInterface.BUTTON_NEGATIVE:\n                    break;\n                }\n            });\n\n            newFile();\n            return;\n        }\n\n        if (Build.VERSION.SDK_INT < Build.VERSION_CODES.R &&\n            checkSelfPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE)\n            != PackageManager.PERMISSION_GRANTED)\n        {\n            alertDialog(this, R.string.files, R.string.manageFiles,\n                        R.string.files, R.string.cancel, (dialog, id) ->\n            {\n                switch (id)\n                {\n                case DialogInterface.BUTTON_POSITIVE:\n                    requestPermissions(new String[]\n                    {Manifest.permission.WRITE_EXTERNAL_STORAGE,\n                     Manifest.permission.READ_EXTERNAL_STORAGE},\n                                       REQUEST_OPEN);\n                    break;\n\n                case DialogInterface.BUTTON_NEGATIVE:\n                    break;\n                }\n            });\n\n            newFile();\n            return;\n        }\n\n        Intent intent = getIntent();\n        Uri uri = intent.getData();\n\n        switch (intent.getAction())\n        {\n        case Intent.ACTION_EDIT:\n        case Intent.ACTION_VIEW:\n            if ((savedInstanceState == null) && (uri != null))\n                readFile(uri);\n\n            getActionBar().setDisplayHomeAsUpEnabled(true);\n            break;\n\n        case Intent.ACTION_SEND:\n            if (savedInstanceState == null)\n            {\n                // Get uri\n                uri = intent.getParcelableExtra(Intent.EXTRA_STREAM);\n                // Get text\n                String text = intent.getStringExtra(Intent.EXTRA_TEXT);\n                if (uri != null)\n                    readFile(uri);\n\n                else if (text != null)\n                {\n                    newFile(text);\n                    changed = true;\n                }\n\n                else\n                    defaultFile();\n            }\n            break;\n\n        case OPEN_NEW:\n            if (savedInstanceState == null)\n            {\n                newFile();\n                textView.postDelayed(() -> editClicked(null), UPDATE_DELAY);\n            }\n            break;\n\n        case Intent.ACTION_MAIN:\n            if (savedInstanceState == null)\n            {\n                if (last)\n                    lastFile();\n\n                else\n                    defaultFile();\n            }\n            break;\n        }\n    }\n\n    // setListeners\n    private void setListeners()\n    {\n        scaleDetector = new ScaleGestureDetector(this, new ScaleListener());\n        queryTextListener = new QueryTextListener();\n\n        if (textView != null)\n        {\n            textView.addTextChangedListener(new TextWatcher()\n            {\n                // afterTextChanged\n                @Override\n                public void afterTextChanged(Editable s)\n                {\n                    if (!changed)\n                    {\n                        changed = true;\n                        invalidateOptionsMenu();\n                    }\n\n                    if (updateHighlight != null)\n                    {\n                        textView.removeCallbacks(updateHighlight);\n                        textView.postDelayed(updateHighlight, UPDATE_DELAY);\n                    }\n\n                    if (updateWordCount != null)\n                    {\n                        textView.removeCallbacks(updateWordCount);\n                        textView.postDelayed(updateWordCount, UPDATE_DELAY);\n                    }\n                }\n\n                // beforeTextChanged\n                @Override\n                public void beforeTextChanged(CharSequence s,\n                                              int start,\n                                              int count,\n                                              int after)\n                {\n                    if (searchItem != null &&\n                        searchItem.isActionViewExpanded())\n                    {\n                        final CharSequence query = searchView.getQuery();\n\n                        textView.postDelayed(() ->\n                        {\n                            if (searchItem != null &&\n                                searchItem.isActionViewExpanded())\n                            {\n                                if (query != null)\n                                    searchView.setQuery(query, false);\n                            }\n                        }, UPDATE_DELAY);\n                    }\n                }\n\n                // onTextChanged\n                @Override\n                public void onTextChanged(CharSequence s,\n                                          int start,\n                                          int before,\n                                          int count) {}\n            });\n\n            // onFocusChange\n            textView.setOnFocusChangeListener((v, hasFocus) ->\n            {\n                // Hide keyboard\n                InputMethodManager manager = (InputMethodManager)\n                    getSystemService(INPUT_METHOD_SERVICE);\n                if (!hasFocus)\n                    manager.hideSoftInputFromWindow(v.getWindowToken(), 0);\n\n                if (updateHighlight != null)\n                {\n                    textView.removeCallbacks(updateHighlight);\n                    textView.postDelayed(updateHighlight, UPDATE_DELAY);\n                }\n            });\n\n            // onLongClick\n            textView.setOnLongClickListener(v ->\n            {\n                // Do nothing if already editable\n                if (edit)\n                    return false;\n\n                // Get scroll position\n                int y = scrollView.getScrollY();\n                // Get height\n                int height = scrollView.getHeight();\n                // Get width\n                int width = scrollView.getWidth();\n\n                // Get offset\n                int line = textView.getLayout()\n                    .getLineForVertical(y + height / 2);\n                int offset = textView.getLayout()\n                    .getOffsetForHorizontal(line, width / 2);\n                // Set cursor\n                textView.setSelection(offset);\n\n                // Set editable with or without suggestions\n                if (suggest)\n                    textView\n                    .setInputType(InputType.TYPE_CLASS_TEXT |\n                                  InputType.TYPE_TEXT_FLAG_MULTI_LINE);\n                else\n                    textView\n                    .setInputType(InputType.TYPE_CLASS_TEXT |\n                                  InputType.TYPE_TEXT_FLAG_MULTI_LINE |\n                                  InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);\n                // Update boolean\n                edit = true;\n\n                // Restart\n                recreate(this);\n\n                return false;\n            });\n\n            textView.getViewTreeObserver().addOnGlobalLayoutListener(() ->\n            {\n                if (updateHighlight != null)\n                {\n                    textView.removeCallbacks(updateHighlight);\n                    textView.postDelayed(updateHighlight, UPDATE_DELAY);\n                }\n            });\n        }\n\n        if (scrollView != null)\n        {\n            // onScrollChange\n            scrollView.getViewTreeObserver().addOnScrollChangedListener(() ->\n            {\n                if (updateHighlight != null)\n                {\n                    textView.removeCallbacks(updateHighlight);\n                    textView.postDelayed(updateHighlight, UPDATE_DELAY);\n                }\n            });\n        }\n    }\n\n    // onRestoreInstanceState\n    @Override\n    public void onRestoreInstanceState(Bundle savedInstanceState)\n    {\n        super.onRestoreInstanceState(savedInstanceState);\n\n        path = savedInstanceState.getString(PATH);\n        edit = savedInstanceState.getBoolean(EDIT);\n        changed = savedInstanceState.getBoolean(CHANGED);\n        match = savedInstanceState.getString(MATCH);\n        modified = savedInstanceState.getLong(MODIFIED);\n        content = savedInstanceState.getParcelable(CONTENT);\n        invalidateOptionsMenu();\n\n        file = new File(path);\n        uri = Uri.fromFile(file);\n\n        if (content != null)\n            setTitle(FileUtils.getDisplayName(this, content, null, null));\n\n        else\n            setTitle(uri.getLastPathSegment());\n\n        if (match == null)\n            match = UTF_8;\n        getActionBar().setSubtitle(match);\n\n        checkHighlight();\n\n        if (file.lastModified() > modified)\n            alertDialog(this, R.string.appName, R.string.changedReload,\n                        R.string.reload, R.string.cancel, (dialog, id) ->\n        {\n            switch (id)\n            {\n            case DialogInterface.BUTTON_POSITIVE:\n                readFile(uri);\n            }\n        });\n    }\n\n    // onPause\n    @Override\n    public void onPause()\n    {\n        super.onPause();\n\n        // Save current path\n        savePath(path);\n\n        // Stop highlighting\n        textView.removeCallbacks(updateHighlight);\n        textView.removeCallbacks(updateWordCount);\n\n        SharedPreferences preferences =\n            PreferenceManager.getDefaultSharedPreferences(this);\n        SharedPreferences.Editor editor = preferences.edit();\n\n        editor.putBoolean(PREF_SAVE, save);\n        editor.putBoolean(PREF_VIEW, view);\n        editor.putBoolean(PREF_LAST, last);\n        editor.putBoolean(PREF_WRAP, wrap);\n        editor.putBoolean(PREF_SUGGEST, suggest);\n        editor.putBoolean(PREF_HIGH, highlight);\n\n        editor.putInt(PREF_THEME, theme);\n        editor.putInt(PREF_SIZE, size);\n        editor.putInt(PREF_TYPE, type);\n\n        editor.putString(PREF_FILE, path);\n\n        // Add the set of recent files\n        editor.putStringSet(PREF_PATHS, pathMap.keySet());\n\n        // Add a position for each file\n        for (String path : pathMap.keySet())\n            editor.putInt(path, pathMap.get(path));\n\n        // Remove the old ones\n        for (String path : removeList)\n            editor.remove(path);\n\n        editor.apply();\n\n        // Save file\n        if (changed && save)\n            saveFile();\n    }\n\n    // onSaveInstanceState\n    @Override\n    public void onSaveInstanceState(Bundle outState)\n    {\n        super.onSaveInstanceState(outState);\n\n        outState.putParcelable(CONTENT, content);\n        outState.putLong(MODIFIED, modified);\n        outState.putBoolean(CHANGED, changed);\n        outState.putString(MATCH, match);\n        outState.putBoolean(EDIT, edit);\n        outState.putString(PATH, path);\n    }\n\n    // onCreateOptionsMenu\n    @Override\n    public boolean onCreateOptionsMenu(Menu menu)\n    {\n        MenuInflater inflater = getMenuInflater();\n        inflater.inflate(R.menu.main, menu);\n\n        return true;\n    }\n\n    // onPrepareOptionsMenu\n    @Override\n    public boolean onPrepareOptionsMenu(Menu menu)\n    {\n        // Set up search view\n        searchItem = menu.findItem(R.id.search);\n        searchView = (SearchView) searchItem.getActionView();\n\n        // Set up search view options and listener\n        if (searchView != null)\n        {\n            searchView.setSubmitButtonEnabled(true);\n            searchView.setImeOptions(EditorInfo.IME_ACTION_GO);\n            searchView.setOnQueryTextListener(queryTextListener);\n        }\n\n        // Show find all item\n        if (menu.findItem(R.id.search).isActionViewExpanded())\n            menu.findItem(R.id.findAll).setVisible(true);\n        else\n            menu.findItem(R.id.findAll).setVisible(false);\n\n        menu.findItem(R.id.edit).setVisible(!edit);\n        menu.findItem(R.id.view).setVisible(edit);\n        menu.findItem(R.id.save).setVisible(changed);\n\n        menu.findItem(R.id.viewFile).setChecked(view);\n        menu.findItem(R.id.openLast).setChecked(last);\n        menu.findItem(R.id.autoSave).setChecked(save);\n        menu.findItem(R.id.wrap).setChecked(wrap);\n        menu.findItem(R.id.suggest).setChecked(suggest);\n        menu.findItem(R.id.highlight).setChecked(highlight);\n\n        switch (theme)\n        {\n        case LIGHT:\n            menu.findItem(R.id.light).setChecked(true);\n            break;\n\n        case DARK:\n            menu.findItem(R.id.dark).setChecked(true);\n            break;\n\n        case SYSTEM:\n            menu.findItem(R.id.system).setChecked(true);\n            break;\n\n        case WHITE:\n            menu.findItem(R.id.white).setChecked(true);\n            break;\n\n        case BLACK:\n            menu.findItem(R.id.black).setChecked(true);\n            break;\n\n        case RETRO:\n            menu.findItem(R.id.retro).setChecked(true);\n            break;\n        }\n\n        switch (size)\n        {\n        case SMALL:\n            menu.findItem(R.id.small).setChecked(true);\n            break;\n\n        case MEDIUM:\n            menu.findItem(R.id.medium).setChecked(true);\n            break;\n\n        case LARGE:\n            menu.findItem(R.id.large).setChecked(true);\n            break;\n        }\n\n        // Get the charsets\n        Set<String> keySet = Charset.availableCharsets().keySet();\n        // Get the submenu\n        MenuItem item = menu.findItem(R.id.charset);\n        item.setTitle(match);\n        SubMenu sub = item.getSubMenu();\n        sub.clear();\n        // Add charsets contained in both sets\n        sub.add(Menu.NONE, R.id.charsetItem, Menu.NONE, R.string.detect);\n        for (String key: keySet)\n            sub.add(Menu.NONE, R.id.charsetItem, Menu.NONE, key);\n\n        // Get the typefaces\n        String typefaces[] = getResources().getStringArray(R.array.typefaces);\n        item = menu.findItem(R.id.typeface);\n        sub = item.getSubMenu();\n        sub.clear();\n        // Add typefaces\n        for (String typeface: typefaces)\n            sub.add(Menu.NONE, R.id.typefaceItem, Menu.NONE, typeface);\n        sub.getItem(type).setCheckable(true);\n        sub.getItem(type).setChecked(true);\n\n        // Get a list of recent files\n        List<Long> list = new ArrayList<>();\n        Map<Long, String> map = new HashMap<>();\n\n        // Get the last modified dates\n        for (String path: pathMap.keySet())\n        {\n            File file = new File(path);\n            // Check it exists\n            if (!file.exists())\n                continue;\n\n            long last = file.lastModified();\n            list.add(last);\n            map.put(last, path);\n        }\n\n        // Sort in reverse order\n        Collections.sort(list);\n        Collections.reverse(list);\n\n        // Get the submenu\n        item = menu.findItem(R.id.openRecent);\n        sub = item.getSubMenu();\n        sub.clear();\n\n        // Add the recent files\n        for (long date : list)\n        {\n            String path = map.get(date);\n\n            // Remove path prefix\n            CharSequence name =\n                path.replaceFirst(Environment\n                                  .getExternalStorageDirectory()\n                                  .getPath() + File.separator, \"\");\n            // Create item\n            sub.add(Menu.NONE, R.id.fileItem, Menu.NONE, TextUtils.ellipsize\n                    (name, new TextPaint(), MENU_SIZE,\n                     TextUtils.TruncateAt.MIDDLE))\n                // Use condensed title to save path as API doesn't\n                // work as documented\n                .setTitleCondensed(name);\n        }\n\n        // Add clear list item\n        sub.add(Menu.NONE, R.id.clearList, Menu.NONE, R.string.clearList);\n\n        return true;\n    }\n\n    // onOptionsItemSelected\n    @Override\n    public boolean onOptionsItemSelected(MenuItem item)\n    {\n        switch (item.getItemId())\n        {\n        case android.R.id.home:\n            onBackPressed();\n            break;\n        case R.id.newFile:\n            newFile();\n            break;\n        case R.id.edit:\n            editClicked(item);\n            break;\n        case R.id.view:\n            viewClicked(item);\n            break;\n        case R.id.open:\n            openFile();\n            break;\n        case R.id.save:\n            saveCheck();\n            break;\n        case R.id.saveAs:\n            saveAs();\n            break;\n        case R.id.clearList:\n            clearList();\n            break;\n        case R.id.findAll:\n            findAll();\n            break;\n        case R.id.goTo:\n            goTo();\n            break;\n        case R.id.print:\n            print();\n            break;\n        case R.id.viewMarkdown:\n            viewMarkdown();\n            break;\n        case R.id.viewFile:\n            viewFileClicked(item);\n            break;\n        case R.id.openLast:\n            openLastClicked(item);\n            break;\n        case R.id.autoSave:\n            autoSaveClicked(item);\n            break;\n        case R.id.wrap:\n            wrapClicked(item);\n            break;\n        case R.id.suggest:\n            suggestClicked(item);\n            break;\n        case R.id.highlight:\n            highlightClicked(item);\n            break;\n        case R.id.light:\n            lightClicked(item);\n            break;\n        case R.id.dark:\n            darkClicked(item);\n            break;\n        case R.id.system:\n            systemClicked(item);\n            break;\n        case R.id.white:\n            whiteClicked(item);\n            break;\n        case R.id.black:\n            blackClicked(item);\n            break;\n        case R.id.retro:\n            retroClicked(item);\n            break;\n        case R.id.small:\n            smallClicked(item);\n            break;\n        case R.id.medium:\n            mediumClicked(item);\n            break;\n        case R.id.large:\n            largeClicked(item);\n            break;\n        case R.id.about:\n            aboutClicked();\n            break;\n        case R.id.fileItem:\n            openRecent(item);\n            break;\n        case R.id.charsetItem:\n            setCharset(item);\n            break;\n        case R.id.typefaceItem:\n            setTypeface(item);\n            break;\n        }\n\n        // Close text search\n        if (searchItem != null && searchItem.isActionViewExpanded() &&\n                item.getItemId() != R.id.findAll)\n            searchItem.collapseActionView();\n\n        return true;\n    }\n\n    // onBackPressed\n    @Override\n    public void onBackPressed()\n    {\n        // Close text search\n        if (searchItem != null && searchItem.isActionViewExpanded())\n        {\n            searchItem.collapseActionView();\n            return;\n        }\n\n        if (changed)\n            alertDialog(this, R.string.appName, R.string.modified,\n                        R.string.save, R.string.discard, (dialog, id) ->\n        {\n            switch (id)\n            {\n            case DialogInterface.BUTTON_POSITIVE:\n                saveFile();\n                finish();\n                break;\n            case DialogInterface.BUTTON_NEGATIVE:\n                changed = false;\n                finish();\n                break;\n            }\n        });\n\n        else\n            finish();\n    }\n\n    // onActivityResult\n    @Override\n    protected void onActivityResult(int requestCode, int resultCode,\n                                    Intent data)\n    {\n        if (resultCode == RESULT_CANCELED)\n            return;\n\n        switch (requestCode)\n        {\n        case OPEN_DOCUMENT:\n            content = data.getData();\n            readFile(content);\n            break;\n\n        case CREATE_DOCUMENT:\n            content = data.getData();\n            setTitle(FileUtils.getDisplayName(this, content, null, null));\n            saveFile();\n            break;\n        }\n    }\n\n    // dispatchTouchEvent\n    @Override\n    public boolean dispatchTouchEvent(MotionEvent event)\n    {\n        scaleDetector.onTouchEvent(event);\n        return super.dispatchTouchEvent(event);\n    }\n\n    // onKeyDown\n    @Override\n    public boolean onKeyDown(int keyCode, KeyEvent event)\n    {\n        // Check Ctrl key\n        if (event.isCtrlPressed())\n        {\n            switch (keyCode)\n            {\n                // Edit, View\n            case KeyEvent.KEYCODE_E:\n                if (event.isShiftPressed())\n                    viewClicked(null);\n                else\n                    editClicked(null);\n                break;\n                // Search\n            case KeyEvent.KEYCODE_F:\n                if (event.isShiftPressed())\n                    searchItem.collapseActionView();\n                else\n                    searchItem.expandActionView();\n                // Find next\n                if (event.isAltPressed() &&\n                    searchItem.isActionViewExpanded())\n                    queryTextListener.onQueryTextSubmit\n                        (searchView.getQuery().toString());\n                break;\n                // Goto\n            case KeyEvent.KEYCODE_G:\n                goTo();\n                break;\n                // Menu\n            case KeyEvent.KEYCODE_M:\n                openOptionsMenu();\n                break;\n                // New\n            case KeyEvent.KEYCODE_N:\n                newFile();\n                break;\n                // Open\n            case KeyEvent.KEYCODE_O:\n                openFile();\n                break;\n                // Print\n            case KeyEvent.KEYCODE_P:\n                print();\n                break;\n                // Save, Save as\n            case KeyEvent.KEYCODE_S:\n                if (event.isShiftPressed())\n                    saveAs();\n                else\n                    saveCheck();\n                break;\n                // Increase text size\n            case KeyEvent.KEYCODE_PLUS:\n            case KeyEvent.KEYCODE_EQUALS:\n                size += 2;\n                size = Math.max(TINY, Math.min(size, HUGE));\n                textView.setTextSize(size);\n                break;\n                // Decrease text size\n            case KeyEvent.KEYCODE_MINUS:\n                size -= 2;\n                size = Math.max(TINY, Math.min(size, HUGE));\n                textView.setTextSize(size);\n                break;\n\n            default:\n                return super.onKeyDown(keyCode, event);\n            }\n\n            return true;\n        }\n\n        else\n        {\n            switch (keyCode)\n            {\n                // Find next\n            case KeyEvent.KEYCODE_F3:\n                if (searchItem.isActionViewExpanded())\n                    queryTextListener.onQueryTextSubmit\n                        (searchView.getQuery().toString());\n                break;\n                // Menu\n            case KeyEvent.KEYCODE_F10:\n                openOptionsMenu();\n                break;\n\n            default:\n                return super.onKeyDown(keyCode, event);\n            }\n\n            return true;\n        }\n    }\n\n    // editClicked\n    private void editClicked(MenuItem item)\n    {\n        // Get scroll position\n        int y = scrollView.getScrollY();\n        // Get height\n        int height = scrollView.getHeight();\n        // Get width\n        int width = scrollView.getWidth();\n\n        // Get offset\n        int line = textView.getLayout()\n            .getLineForVertical(y + height / 2);\n        int offset = textView.getLayout()\n            .getOffsetForHorizontal(line, width / 2);\n        // Set cursor\n        textView.setSelection(offset);\n\n        // Set editable with or without suggestions\n        if (suggest)\n            textView.setInputType(InputType.TYPE_CLASS_TEXT |\n                                  InputType.TYPE_TEXT_FLAG_MULTI_LINE);\n        else\n            textView.setInputType(InputType.TYPE_CLASS_TEXT |\n                                  InputType.TYPE_TEXT_FLAG_MULTI_LINE |\n                                  InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);\n        // Update boolean\n        edit = true;\n\n        // Recreate\n        recreate(this);\n    }\n\n    // viewClicked\n    private void viewClicked(MenuItem item)\n    {\n        // Set read only\n        textView.setRawInputType(InputType.TYPE_NULL);\n        textView.setTextIsSelectable(true);\n        textView.clearFocus();\n\n        // Update boolean\n        edit = false;\n\n        // Update menu\n        invalidateOptionsMenu();\n    }\n\n    // newFile\n    private void newFile()\n    {\n        // Check if file changed\n        if (changed)\n            alertDialog(this, R.string.newFile, R.string.modified,\n                        R.string.save, R.string.discard, (dialog, id) ->\n        {\n            switch (id)\n            {\n            case DialogInterface.BUTTON_POSITIVE:\n                saveFile();\n                newFile(null);\n                break;\n\n            case DialogInterface.BUTTON_NEGATIVE:\n                newFile(null);\n                break;\n            }\n\n            invalidateOptionsMenu();\n        });\n\n        else\n            newFile(null);\n\n        invalidateOptionsMenu();\n    }\n\n    // newFile\n    private void newFile(String text)\n    {\n        textView.setText(\"\");\n        changed = false;\n\n        file = getNewFile();\n        uri = Uri.fromFile(file);\n        path = uri.getPath();\n        content = null;\n\n        if (text != null)\n            textView.append(text);\n\n        setTitle(uri.getLastPathSegment());\n        match = UTF_8;\n        getActionBar().setSubtitle(match);\n    }\n\n    // getNewFile\n    private static File getNewFile()\n    {\n        File documents = new\n            File(Environment.getExternalStorageDirectory(), DOCUMENTS);\n        return new File(documents, NEW_FILE);\n    }\n\n    // getDefaultFile\n    private static File getDefaultFile()\n    {\n        File documents = new\n            File(Environment.getExternalStorageDirectory(), DOCUMENTS);\n        return new File(documents, EDIT_FILE);\n    }\n\n    // defaultFile\n    private void defaultFile()\n    {\n        file = getDefaultFile();\n        uri = Uri.fromFile(file);\n        path = uri.getPath();\n        content = null;\n\n        if (file.exists())\n            readFile(uri);\n\n        else\n        {\n            setTitle(uri.getLastPathSegment());\n            match = UTF_8;\n            getActionBar().setSubtitle(match);\n        }\n    }\n\n    // lastFile\n    private void lastFile()\n    {\n        SharedPreferences preferences =\n            PreferenceManager.getDefaultSharedPreferences(this);\n\n        String path = preferences.getString(PREF_FILE, \"\");\n        if (path.isEmpty())\n        {\n            defaultFile();\n            return;\n        }\n\n        file = new File(path);\n        uri = Uri.fromFile(file);\n        path = uri.getPath();\n\n        if (file.exists())\n            readFile(uri);\n\n        else\n        {\n            setTitle(uri.getLastPathSegment());\n            match = UTF_8;\n            getActionBar().setSubtitle(match);\n        }\n    }\n\n    // setCharset\n    private void setCharset(MenuItem item)\n    {\n        match = item.getTitle().toString();\n        getActionBar().setSubtitle(match);\n    }\n\n    // setTypeface\n    private void setTypeface(MenuItem item)\n    {\n        String name = item.getTitle().toString();\n        Typeface typeface = Typeface.create(name, Typeface.NORMAL);\n        textView.setTypeface(typeface);\n        item.setChecked(true);\n        String typefaces[] = getResources().getStringArray(R.array.typefaces);\n        List<String> list = Arrays.asList(typefaces);\n        type = list.indexOf(name);\n    }\n\n    // alertDialog\n    private static void alertDialog(Context context, int title, int message,\n                                    int positiveButton, int negativeButton,\n                                    DialogInterface.OnClickListener listener)\n    {\n        AlertDialog.Builder builder = new AlertDialog.Builder(context);\n        builder.setTitle(title);\n        builder.setMessage(message);\n\n        // Add the buttons\n        builder.setPositiveButton(positiveButton, listener);\n        builder.setNegativeButton(negativeButton, listener);\n\n        // Create the AlertDialog\n        builder.show();\n    }\n\n    // alertDialog\n    private static void alertDialog(Context context, int title,\n                                    String message, int neutralButton)\n    {\n        AlertDialog.Builder builder = new AlertDialog.Builder(context);\n        builder.setTitle(title);\n        builder.setMessage(message);\n\n        // Add the buttons\n        builder.setNeutralButton(neutralButton, null);\n\n        // Create the AlertDialog\n        builder.show();\n    }\n\n    // savePath\n    private void savePath(String path)\n    {\n        if (path == null)\n            return;\n\n        // Save the current position\n        pathMap.put(path, scrollView.getScrollY());\n\n        // Get a list of files\n        List<Long> list = new ArrayList<>();\n        Map<Long, String> map = new HashMap<>();\n        for (String name: pathMap.keySet())\n        {\n            File file = new File(name);\n            // Add to remove list if non existant\n            if (!file.exists())\n            {\n                removeList.add(name);\n                continue;\n            }\n\n            list.add(file.lastModified());\n            map.put(file.lastModified(), name);\n        }\n\n        // Remove non existant entries\n        for (String name: removeList)\n            pathMap.remove(name);\n\n        // Sort in reverse order\n        Collections.sort(list);\n        Collections.reverse(list);\n\n        int count = 0;\n        for (long date : list)\n        {\n            String name = map.get(date);\n\n            // Remove old files\n            if (count >= MAX_PATHS)\n            {\n                pathMap.remove(name);\n                removeList.add(name);\n            }\n\n            count++;\n        }\n    }\n\n    // openRecent\n    private void openRecent(MenuItem item)\n    {\n        // Get path from condensed title\n        String name = item.getTitleCondensed().toString();\n        File file = new File(name);\n\n        // Check absolute file\n        if (!file.isAbsolute())\n            file = new File(Environment.getExternalStorageDirectory(), name);\n        // Check it exists\n        if (file.exists())\n        {\n            Uri uri = Uri.fromFile(file);\n\n            if (changed)\n                alertDialog(this, R.string.openRecent, R.string.modified,\n                            R.string.save, R.string.discard, (dialog, id) ->\n            {\n                switch (id)\n                {\n                case DialogInterface.BUTTON_POSITIVE:\n                    saveFile();\n                    startActivity(new Intent(Intent.ACTION_EDIT, uri,\n                                             this, Editor.class));\n                    break;\n\n                case DialogInterface.BUTTON_NEGATIVE:\n                    startActivity(new Intent(Intent.ACTION_EDIT, uri,\n                                             this, Editor.class));\n                    break;\n                }\n            });\n\n            else\n                // New instance\n                startActivity(new Intent(Intent.ACTION_EDIT, uri,\n                                         this, Editor.class));\n        }\n    }\n\n    // saveAs\n    private void saveAs()\n    {\n        // Remove path prefix\n        String name =\n            path.replaceFirst(Environment\n                              .getExternalStorageDirectory()\n                              .getPath() + File.separator, \"\");\n        // Open dialog\n        saveAsDialog(this, name, (dialog, id) ->\n        {\n            switch (id)\n            {\n            case DialogInterface.BUTTON_POSITIVE:\n                EditText text = ((Dialog) dialog).findViewById(R.id.pathText);\n                String string = text.getText().toString();\n\n                // Ignore empty string\n                if (string.isEmpty())\n                    return;\n\n                file = new File(string);\n\n                // Check absolute file\n                if (!file.isAbsolute())\n                    file = new\n                        File(Environment.getExternalStorageDirectory(), string);\n\n                // Check uri\n                uri = Uri.fromFile(file);\n                Uri newUri = Uri.fromFile(getNewFile());\n                if (newUri.getPath().equals(uri.getPath()))\n                {\n                    saveAs();\n                    return;\n                }\n\n                // Check exists\n                if (file.exists())\n                    alertDialog(this, R.string.appName,\n                                R.string.changedOverwrite,\n                                R.string.overwrite, R.string.cancel, (d, b) ->\n                    {\n                        switch (b)\n                        {\n                        case DialogInterface.BUTTON_POSITIVE:\n                            // Set interface title\n                            setTitle(uri.getLastPathSegment());\n                            path = file.getPath();\n                            saveFile();\n                            break;\n                        }\n                    });\n\n                else\n                {\n                    // Set interface title\n                    setTitle(uri.getLastPathSegment());\n                    path = file.getPath();\n                    content = null;\n                    saveFile();\n                }\n                break;\n\n            case DialogInterface.BUTTON_NEUTRAL:\n                Intent intent = new Intent(Intent.ACTION_CREATE_DOCUMENT);\n                intent.setType(TEXT_WILD);\n                intent.addCategory(Intent.CATEGORY_OPENABLE);\n                intent.putExtra(Intent.EXTRA_TITLE, uri.getLastPathSegment());\n                startActivityForResult(intent, CREATE_DOCUMENT);\n                break;\n            }\n        });\n    }\n\n    // saveAsDialog\n    private static void saveAsDialog(Context context, String path,\n                                     DialogInterface.OnClickListener listener)\n    {\n        AlertDialog.Builder builder = new AlertDialog.Builder(context);\n        builder.setTitle(R.string.save);\n        builder.setMessage(R.string.choose);\n\n        // Add the buttons\n        builder.setPositiveButton(R.string.save, listener);\n        builder.setNegativeButton(R.string.cancel, listener);\n        builder.setNeutralButton(R.string.storage, listener);\n\n        // Create edit text\n        LayoutInflater inflater = (LayoutInflater) builder.getContext()\n            .getSystemService(LAYOUT_INFLATER_SERVICE);\n        View view = inflater.inflate(R.layout.save_path, null);\n        builder.setView(view);\n\n        // Create the AlertDialog\n        AlertDialog dialog = builder.show();\n        TextView text = dialog.findViewById(R.id.pathText);\n        text.setText(path);\n    }\n\n    // clearList\n    private void clearList()\n    {\n        for (String path : pathMap.keySet())\n            removeList.add(path);\n\n        pathMap.clear();\n    }\n\n    // findAll\n    public void findAll()\n    {\n        // Get search string\n        String search = searchView.getQuery().toString();\n\n        doFind(this, search);\n    }\n\n    // goTo\n    public void goTo()\n    {\n        gotoDialog((seekBar, progress) ->\n        {\n            int height = textView.getHeight();\n            int pos = progress * height / seekBar.getMax();\n\n            // Scroll to it\n            scrollView.smoothScrollTo(0, pos);\n        });\n    }\n\n    // OnSeekBarChangeListener\n    public interface OnSeekBarChangeListener\n    {\n        abstract void onProgressChanged(SeekBar seekBar, int progress);\n    }\n\n    // GotoDialog\n    private void gotoDialog(OnSeekBarChangeListener listener)\n    {\n        AlertDialog.Builder builder = new AlertDialog.Builder(this);\n        builder.setTitle(R.string.goTo);\n\n        // Add the buttons\n        builder.setNegativeButton(R.string.cancel, null);\n\n        // Create seek bar\n        LayoutInflater inflater = (LayoutInflater) builder.getContext()\n            .getSystemService(LAYOUT_INFLATER_SERVICE);\n        View view = inflater.inflate(R.layout.seek_bar, null);\n        builder.setView(view);\n\n        // Create the AlertDialog\n        AlertDialog dialog = builder.show();\n        SeekBar seekBar = dialog.findViewById(R.id.seekBar);\n        int height = textView.getHeight();\n        int progress = scrollView.getScrollY() * seekBar.getMax() / height;\n        seekBar.setProgress(progress);\n        seekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener()\n        {\n            @Override\n            public void onProgressChanged(SeekBar seekBar,\n                                          int progress,\n                                          boolean fromUser)\n            {\n                if (fromUser)\n                    listener.onProgressChanged(seekBar, progress);\n            }\n\n            @Override\n            public void onStartTrackingTouch (SeekBar seekBar) {}\n\n            @Override\n            public void onStopTrackingTouch (SeekBar seekBar)\n            {\n                dialog.dismiss();\n            }\n        });\n    }\n\n    // print\n    @SuppressWarnings(\"deprecation\")\n    private void print()\n    {\n        WebView webView = new WebView(this);\n\n        webView.setWebViewClient(new WebViewClient()\n        {\n            @Override\n            public boolean shouldOverrideUrlLoading(WebView view, String url)\n            {\n                return false;\n            }\n\n            @Override\n            public void onPageFinished(WebView view, String url)\n            {\n                // Get a PrintManager instance\n                PrintManager printManager = (PrintManager)\n                    getSystemService(PRINT_SERVICE);\n\n                String jobName = getString(R.string.appName) + \" Document\";\n\n                // Get a print adapter instance\n                PrintDocumentAdapter printAdapter =\n                    view.createPrintDocumentAdapter(jobName);\n\n                // Create a print job with name and adapter instance\n                printManager\n                    .print(jobName, printAdapter,\n                           new PrintAttributes.Builder()\n                           .setMediaSize(PrintAttributes.MediaSize.ISO_A4)\n                           .build());\n            }\n        });\n\n        String htmlDocument = \n            HTML_HEAD + Html.toHtml(textView.getText()) + HTML_TAIL;\n        webView.loadData(htmlDocument, TEXT_HTML, UTF_8);\n    }\n\n    // viewMarkdown\n    private void viewMarkdown()\n    {\n        String text = textView.getText().toString();\n\n        // Use commonmark\n        Parser parser = Parser.builder().build();\n        Node document = parser.parse(text);\n        HtmlRenderer renderer = HtmlRenderer.builder().build();\n\n        String html = renderer.render(document);\n\n        File file = new File(getCacheDir(), HTML_FILE);\n        file.deleteOnExit();\n\n        try (FileWriter writer = new FileWriter(file))\n        {\n            // Add HTML header and footer to make a valid page.\n            writer.write(HTML_HEAD);\n            writer.write(html);\n            writer.write(HTML_TAIL);\n        }\n\n        catch (Exception e)\n        {\n            e.printStackTrace();\n        }\n\n        try\n        {\n            // Get file provider uri\n            Uri uri = FileProvider.getUriForFile\n                (this, FILE_PROVIDER, file);\n            Intent intent = new Intent(Intent.ACTION_VIEW);\n            intent.setDataAndType(uri, TEXT_HTML);\n            intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);\n            startActivity(intent);\n        }\n\n        catch (Exception e)\n        {\n            e.printStackTrace();\n        }\n    }\n\n    // viewFileClicked\n    private void viewFileClicked(MenuItem item)\n    {\n        view = !view;\n        item.setChecked(view);\n    }\n\n    // openLastClicked\n    private void openLastClicked(MenuItem item)\n    {\n        last = !last;\n        item.setChecked(last);\n    }\n\n    // autoSaveClicked\n    private void autoSaveClicked(MenuItem item)\n    {\n        save = !save;\n        item.setChecked(save);\n    }\n\n    // wrapClicked\n    private void wrapClicked(MenuItem item)\n    {\n        wrap = !wrap;\n        item.setChecked(wrap);\n        recreate(this);\n    }\n\n    // suggestClicked\n    private void suggestClicked(MenuItem item)\n    {\n        suggest = !suggest;\n        item.setChecked(suggest);\n\n        if (suggest)\n            textView.setRawInputType(InputType.TYPE_CLASS_TEXT |\n                                     InputType.TYPE_TEXT_FLAG_MULTI_LINE);\n        else\n            textView.setRawInputType(InputType.TYPE_CLASS_TEXT |\n                                     InputType.TYPE_TEXT_FLAG_MULTI_LINE |\n                                     InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);\n        recreate(this);\n    }\n\n    // highlightClicked\n    private void highlightClicked(MenuItem item)\n    {\n        highlight = !highlight;\n        item.setChecked(highlight);\n\n        checkHighlight();\n    }\n\n    // lightClicked\n    private void lightClicked(MenuItem item)\n    {\n        theme = LIGHT;\n        item.setChecked(true);\n        recreate(this);\n    }\n\n    // darkClicked\n    private void darkClicked(MenuItem item)\n    {\n        theme = DARK;\n        item.setChecked(true);\n        recreate(this);\n    }\n\n    // systemClicked\n    private void systemClicked(MenuItem item)\n    {\n        theme = SYSTEM;\n        item.setChecked(true);\n        recreate(this);\n    }\n\n    // whiteClicked\n    private void whiteClicked(MenuItem item)\n    {\n        theme = WHITE;\n        item.setChecked(true);\n        recreate(this);\n    }\n\n    // blackClicked\n    private void blackClicked(MenuItem item)\n    {\n        theme = BLACK;\n        item.setChecked(true);\n        recreate(this);\n    }\n\n    // retroClicked\n    private void retroClicked(MenuItem item)\n    {\n        theme = RETRO;\n        item.setChecked(true);\n        recreate(this);\n    }\n\n    // smallClicked\n    private void smallClicked(MenuItem item)\n    {\n        size = SMALL;\n        item.setChecked(true);\n\n        textView.setTextSize(size);\n    }\n\n    // mediumClicked\n    private void mediumClicked(MenuItem item)\n    {\n        size = MEDIUM;\n        item.setChecked(true);\n\n        textView.setTextSize(size);\n    }\n\n    // largeClicked\n    private void largeClicked(MenuItem item)\n    {\n        size = LARGE;\n        item.setChecked(true);\n\n        textView.setTextSize(size);\n    }\n\n    // setSizeAndTypeface\n    private void setSizeAndTypeface(int size, int type)\n    {\n        // Set size\n        textView.setTextSize(size);\n\n        // Set type\n        String names[] = getResources().getStringArray(R.array.typefaces);\n        Typeface typeface = Typeface.create(names[type], Typeface.NORMAL);\n        textView.setTypeface(typeface);\n    }\n\n    // aboutClicked\n    @SuppressWarnings(\"deprecation\")\n    private void aboutClicked()\n    {\n        AlertDialog.Builder builder = new AlertDialog.Builder(this);\n        builder.setTitle(R.string.appName);\n\n        DateFormat dateFormat = DateFormat.getDateTimeInstance();\n        SpannableStringBuilder spannable =\n            new SpannableStringBuilder(getText(R.string.version));\n        Pattern pattern = Pattern.compile(\"%s\");\n        Matcher matcher = pattern.matcher(spannable);\n        if (matcher.find())\n            spannable.replace(matcher.start(), matcher.end(),\n                              BuildConfig.VERSION_NAME);\n        matcher.reset(spannable);\n        if (matcher.find())\n            spannable.replace(matcher.start(), matcher.end(),\n                              dateFormat.format(BuildConfig.BUILT));\n        builder.setMessage(spannable);\n\n        // Add the button\n        builder.setPositiveButton(R.string.ok, null);\n\n        // Create the AlertDialog\n        Dialog dialog = builder.show();\n\n        // Set movement method\n        TextView text = dialog.findViewById(android.R.id.message);\n        if (text != null)\n        {\n            text.setTextAppearance(builder.getContext(),\n                                   android.R.style.TextAppearance_Small);\n            text.setMovementMethod(LinkMovementMethod.getInstance());\n        }\n    }\n\n    // recreate\n    private void recreate(Context context)\n    {\n        if (Build.VERSION.SDK_INT != Build.VERSION_CODES.M)\n            recreate();\n    }\n\n    // openFile\n    private void openFile()\n    {\n        // Check if file changed\n        if (changed)\n            alertDialog(this, R.string.open, R.string.modified,\n                        R.string.save, R.string.discard, (dialog, id) ->\n        {\n            switch (id)\n            {\n            case DialogInterface.BUTTON_POSITIVE:\n                saveFile();\n                getFile();\n                break;\n\n            case DialogInterface.BUTTON_NEGATIVE:\n                changed = false;\n                getFile();\n                break;\n            }\n        });\n\n        else\n            getFile();\n\n    }\n\n    // getFile\n    private void getFile()\n    {\n        // Open parent folder\n        File dir = file.getParentFile();\n        getFile(dir);\n    }\n\n    // getFile\n    private void getFile(File dir)\n    {\n        // Get list of files\n        List<File> fileList = getList(dir);\n        if (fileList == null)\n            return;\n\n        // Get list of folders\n        List<String> dirList = new ArrayList<String>();\n        dirList.add(File.separator);\n        dirList.addAll(Uri.fromFile(dir).getPathSegments());\n\n        // Pop up dialog\n        openDialog(this, dirList, fileList, (dialog, which) ->\n        {\n            if (DialogInterface.BUTTON_NEUTRAL == which)\n            {\n                // Use storage\n                Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);\n                intent.setType(TEXT_WILD);\n                intent.addCategory(Intent.CATEGORY_OPENABLE);\n                startActivityForResult(intent, OPEN_DOCUMENT);\n                return;\n            }\n\n            if (FOLDER_OFFSET <= which)\n            {\n                File file = new File(File.separator);\n                for (int i = 0; i <= which - FOLDER_OFFSET; i++)\n                    file = new File(file, dirList.get(i));\n                if (file.isDirectory())\n                    getFile(file);\n                return;\n            }\n\n            File selection = fileList.get(which);\n            if (selection.isDirectory())\n                getFile(selection);\n\n            else\n                readFile(Uri.fromFile(selection));\n        });\n    }\n\n    // getList\n    public static List<File> getList(File dir)\n    {\n        List<File> list = null;\n        File[] files = dir.listFiles();\n        // Check files\n        if (files == null)\n        {\n            // Create a list with just the parent folder and the\n            // external storage folder\n            list = new ArrayList<File>();\n            if (dir.getParentFile() == null)\n                list.add(dir);\n\n            else\n                list.add(dir.getParentFile());\n\n            list.add(Environment.getExternalStorageDirectory());\n\n            return list;\n        }\n\n        // Sort the files\n        Arrays.sort(files);\n        // Create a list\n        list = new ArrayList<File>(Arrays.asList(files));\n\n        // Add parent folder\n        if (dir.getParentFile() == null)\n            list.add(0, dir);\n\n        else\n            list.add(0, dir.getParentFile());\n\n        return list;\n    }\n\n    // openDialog\n    public static void openDialog(Context context, List<String> dirList,\n                                  List<File> fileList,\n                                  DialogInterface.OnClickListener listener)\n    {\n        AlertDialog.Builder builder = new AlertDialog.Builder(context);\n        builder.setTitle(FOLDER);\n\n        // Add the adapter\n        FileAdapter adapter = new FileAdapter(builder.getContext(), fileList);\n        builder.setAdapter(adapter, listener);\n\n        // Add storage button\n        builder.setNeutralButton(R.string.storage, listener);\n        // Add cancel button\n        builder.setNegativeButton(R.string.cancel, null);\n\n        // Create the Dialog\n        AlertDialog dialog = builder.create();\n        dialog.show();\n\n        // Find the title view\n        ViewGroup title = dialog.findViewById\n            (context.getResources().getIdentifier(\"title_template\",\n                                                  \"id\", \"android\"));\n        // Replace content with scroll view\n        title.removeAllViews();\n        HorizontalScrollView scroll = new\n            HorizontalScrollView(dialog.getContext());\n        title.addView(scroll);\n        // Add a row of folder buttons\n        LinearLayout layout = new LinearLayout(dialog.getContext());\n        scroll.addView(layout);\n        for (String dir: dirList)\n        {\n            Button button = new Button(dialog.getContext(), null,\n                                       android.R.attr.buttonStyleSmall);\n            button.setId(dirList.indexOf(dir) + FOLDER_OFFSET);\n            button.setText(dir);\n            button.setOnClickListener((v) ->\n            {\n                listener.onClick(dialog, v.getId());\n                dialog.dismiss();\n            });\n            layout.addView(button);\n        }\n\n        // Scroll to the end\n        scroll.postDelayed(() ->\n        {\n            scroll.fullScroll(View.FOCUS_RIGHT);\n        }, POSITION_DELAY);\n    }\n\n    // onRequestPermissionsResult\n    @Override\n    public void onRequestPermissionsResult(int requestCode,\n                                           String[] permissions,\n                                           int[] grantResults)\n    {\n        switch (requestCode)\n        {\n        case REQUEST_OPEN:\n            for (int i = 0; i < grantResults.length; i++)\n                if (permissions[i].equals(Manifest.permission\n                                          .READ_EXTERNAL_STORAGE) &&\n                    grantResults[i] == PackageManager.PERMISSION_GRANTED)\n                    // Granted, open file\n                    getFile();\n            break;\n        }\n    }\n\n    // readFile\n    private void readFile(Uri uri)\n    {\n        if (uri == null)\n            return;\n\n        long size = 0;\n        if (CONTENT.equalsIgnoreCase(uri.getScheme()))\n            size = FileUtils.getSize(this, uri, null, null);\n\n        else\n        {\n            File file = new File(uri.getPath());\n            size = file.length();\n        }\n\n        if (BuildConfig.DEBUG)\n            Log.d(TAG, \"Size \" + size);\n\n        if (size > TOO_LARGE)\n        {\n            String large = getString(R.string.tooLarge);\n            large = String.format(large, FileUtils.getReadableFileSize(size));\n            alertDialog(this, R.string.appName, large, R.string.ok);\n            return;\n        }\n\n        // Stop highlighting\n        textView.removeCallbacks(updateHighlight);\n        textView.removeCallbacks(updateWordCount);\n\n        if (BuildConfig.DEBUG)\n            Log.d(TAG, \"Uri: \" + uri);\n\n        // Attempt to resolve content uri\n        if (CONTENT.equalsIgnoreCase(uri.getScheme()))\n        {\n            content = uri;\n            uri = resolveContent(uri);\n        }\n\n        else\n            content = null;\n\n        if (BuildConfig.DEBUG)\n            Log.d(TAG, \"Uri: \" + uri);\n\n        // Read into new file if unresolved\n        if (CONTENT.equalsIgnoreCase(uri.getScheme()))\n        {\n            file = getNewFile();\n            Uri defaultUri = Uri.fromFile(file);\n            path = defaultUri.getPath();\n\n            setTitle(FileUtils.getDisplayName(this, content, null, null));\n        }\n\n        // Read file\n        else\n        {\n            this.uri = uri;\n            path = uri.getPath();\n            file = new File(path);\n\n            setTitle(uri.getLastPathSegment());\n        }\n\n        textView.setText(R.string.loading);\n\n        doRead(this, uri);\n\n        changed = false;\n        modified = file.lastModified();\n        savePath(path);\n        invalidateOptionsMenu();\n    }\n\n    // resolveContent\n    private Uri resolveContent(Uri uri)\n    {\n        String path = FileUtils.getPath(this, uri);\n\n        if (path != null)\n        {\n            File file = new File(path);\n            if (file.canRead())\n                uri = Uri.fromFile(file);\n        }\n\n        return uri;\n    }\n\n    // saveCheck\n    private void saveCheck()\n    {\n        Uri uri = Uri.fromFile(file);\n        Uri newUri = Uri.fromFile(getNewFile());\n        if (content == null && newUri.getPath().equals(uri.getPath()))\n            saveAs();\n\n        else\n            saveFile();\n    }\n\n    // saveFile\n    private void saveFile()\n    {\n        // Stop highlighting\n        textView.removeCallbacks(updateHighlight);\n        textView.removeCallbacks(updateWordCount);\n\n        if (file.lastModified() > modified)\n            alertDialog(this, R.string.appName, R.string.changedOverwrite,\n                        R.string.overwrite, R.string.cancel, (dialog, id) ->\n        {\n            switch (id)\n            {\n            case DialogInterface.BUTTON_POSITIVE:\n                saveFile(file);\n                break;\n            }\n        });\n\n        else\n        {\n            if (content == null)\n                saveFile(file);\n\n            else\n                saveFile(content);\n        }\n    }\n\n    // saveFile\n    private void saveFile(File file)\n    {\n        CharSequence text = textView.getText();\n        write(text, file);\n    }\n\n    // saveFile\n    private void saveFile(Uri uri)\n    {\n        CharSequence text = textView.getText();\n        try (OutputStream outputStream =\n             getContentResolver().openOutputStream(uri, \"rwt\"))\n        {\n            write(text, outputStream);\n        }\n\n        catch (Exception e)\n        {\n            alertDialog(this, R.string.appName, e.getMessage(), R.string.ok);\n            e.printStackTrace();\n            return;\n        }\n    }\n\n    // write\n    private void write(CharSequence text, File file)\n    {\n        file.getParentFile().mkdirs();\n\n        String charset = UTF_8;\n        if (match != null && !match.equals(getString(R.string.detect)))\n            charset = match;\n\n        try (BufferedWriter writer = new BufferedWriter\n             (new OutputStreamWriter(new FileOutputStream(file), charset)))\n        {\n            writer.append(text);\n            writer.flush();\n        }\n\n        catch (Exception e)\n        {\n            alertDialog(this, R.string.appName, e.getMessage(), R.string.ok);\n            e.printStackTrace();\n            return;\n        }\n\n        changed = false;\n        invalidateOptionsMenu();\n        modified = file.lastModified();\n        savePath(file.getPath());\n    }\n\n    // write\n    private void write(CharSequence text, OutputStream os)\n    {\n        String charset = UTF_8;\n        if (match != null && !match.equals(getString(R.string.detect)))\n            charset = match;\n\n        try (BufferedWriter writer =\n             new BufferedWriter(new OutputStreamWriter(os, charset)))\n        {\n            writer.append(text);\n            writer.flush();\n        }\n\n        catch (Exception e)\n        {\n            alertDialog(this, R.string.appName, e.getMessage(), R.string.ok);\n            e.printStackTrace();\n            return;\n        }\n\n        changed = false;\n        invalidateOptionsMenu();\n    }\n\n    // checkHighlight\n    private void checkHighlight()\n    {\n        // No syntax\n        syntax = NO_SYNTAX;\n\n        // Check extension\n        if (highlight && file != null)\n        {\n            String ext = FileUtils.getExtension(file.getName());\n            if (ext != null)\n            {\n                String type = FileUtils.getMimeType(file);\n\n                if (ext.matches(CC_EXT))\n                    syntax = CC_SYNTAX;\n\n                else if (ext.matches(HTML_EXT))\n                    syntax = HTML_SYNTAX;\n\n                else if (ext.matches(CSS_EXT))\n                    syntax = CSS_SYNTAX;\n\n                else if (ext.matches(ORG_EXT))\n                    syntax = ORG_SYNTAX;\n\n                else if (ext.matches(MD_EXT))\n                    syntax = MD_SYNTAX;\n\n                else if (ext.matches(SH_EXT))\n                    syntax = SH_SYNTAX;\n\n                else if (!TEXT_PLAIN.equals(type))\n                    syntax = DEF_SYNTAX;\n\n                else\n                    syntax = NO_SYNTAX;\n\n                // Add callback\n                if (textView != null && syntax != NO_SYNTAX)\n                {\n                    if (updateHighlight == null)\n                        updateHighlight = () -> highlightText();\n\n                    textView.removeCallbacks(updateHighlight);\n                    textView.postDelayed(updateHighlight, UPDATE_DELAY);\n\n                    return;\n                }\n            }\n        }\n\n        // Remove highlighting\n        if (updateHighlight != null)\n        {\n            textView.removeCallbacks(updateHighlight);\n            textView.postDelayed(updateHighlight, UPDATE_DELAY);\n\n            updateHighlight = null;\n        }\n    }\n\n    // highlightText\n    private void highlightText()\n    {\n        // Get visible extent\n        int top = scrollView.getScrollY();\n        int height = scrollView.getHeight();\n\n        int line = textView.getLayout().getLineForVertical(top);\n        int start = textView.getLayout().getLineStart(line);\n        int first = textView.getLayout().getLineStart(line + 1);\n\n        line = textView.getLayout().getLineForVertical(top + height);\n        int end = textView.getLayout().getLineEnd(line);\n        int last = (line == 0)? end:\n            textView.getLayout().getLineStart(line - 1);\n\n        // Move selection if outside range\n        if (textView.getSelectionStart() < start)\n            textView.setSelection(first);\n\n        if (textView.getSelectionStart() > end)\n            textView.setSelection(last);\n\n        // Get editable\n        Editable editable = textView.getEditableText();\n\n        // Get current spans\n        ForegroundColorSpan spans[] =\n            editable.getSpans(start, end, ForegroundColorSpan.class);\n        // Remove spans\n        for (ForegroundColorSpan span: spans)\n            editable.removeSpan(span);\n\n        Matcher matcher;\n\n        switch (syntax)\n        {\n        case NO_SYNTAX:\n            // Get current spans\n            spans = editable.getSpans(0, editable.length(),\n                                      ForegroundColorSpan.class);\n            // Remove spans\n            for (ForegroundColorSpan span: spans)\n                editable.removeSpan(span);\n            break;\n\n        case CC_SYNTAX:\n            matcher = KEYWORDS.matcher(editable);\n            matcher.region(start, end);\n            while (matcher.find())\n            {\n                ForegroundColorSpan span = new\n                    ForegroundColorSpan(Color.CYAN);\n\n                // Highlight it\n                editable.setSpan(span, matcher.start(), matcher.end(),\n                                 Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);\n            }\n\n            matcher.region(start, end).usePattern(TYPES);\n            while (matcher.find())\n            {\n                ForegroundColorSpan span = new\n                    ForegroundColorSpan(Color.MAGENTA);\n\n                // Highlight it\n                editable.setSpan(span, matcher.start(), matcher.end(),\n                                 Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);\n            }\n\n            matcher.region(start, end).usePattern(CLASS);\n            while (matcher.find())\n            {\n                ForegroundColorSpan span = new\n                    ForegroundColorSpan(Color.BLUE);\n\n                // Highlight it\n                editable.setSpan(span, matcher.start(), matcher.end(),\n                                 Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);\n            }\n\n            matcher.region(start, end).usePattern(NUMBER);\n            while (matcher.find())\n            {\n                ForegroundColorSpan span = new\n                    ForegroundColorSpan(Color.YELLOW);\n\n                // Highlight it\n                editable.setSpan(span, matcher.start(), matcher.end(),\n                                 Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);\n            }\n\n            matcher.region(start, end).usePattern(ANNOTATION);\n            while (matcher.find())\n            {\n                ForegroundColorSpan span = new\n                    ForegroundColorSpan(Color.CYAN);\n\n                // Highlight it\n                editable.setSpan(span, matcher.start(), matcher.end(),\n                                 Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);\n            }\n\n            matcher.region(start, end).usePattern(CONSTANT);\n            while (matcher.find())\n            {\n                ForegroundColorSpan span = new\n                    ForegroundColorSpan(Color.LTGRAY);\n\n                // Highlight it\n                editable.setSpan(span, matcher.start(), matcher.end(),\n                                 Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);\n            }\n\n            matcher.region(start, end).usePattern(OPERATOR);\n            while (matcher.find())\n            {\n                ForegroundColorSpan span = new\n                    ForegroundColorSpan(Color.CYAN);\n\n                // Highlight it\n                editable.setSpan(span, matcher.start(), matcher.end(),\n                                 Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);\n            }\n\n            matcher.region(start, end).usePattern(CC_COMMENT);\n            while (matcher.find())\n            {\n                ForegroundColorSpan span = new\n                    ForegroundColorSpan(Color.RED);\n\n                // Highlight it\n                editable.setSpan(span, matcher.start(), matcher.end(),\n                                 Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);\n            }\n            break;\n\n        case HTML_SYNTAX:\n            matcher = HTML_TAGS.matcher(editable);\n            matcher.region(start, end);\n            while (matcher.find())\n            {\n                ForegroundColorSpan span = new\n                    ForegroundColorSpan(Color.CYAN);\n\n                // Highlight it\n                editable.setSpan(span, matcher.start(), matcher.end(),\n                                 Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);\n            }\n\n            matcher.region(start, end).usePattern(HTML_ATTRS);\n            while (matcher.find())\n            {\n                ForegroundColorSpan span = new\n                    ForegroundColorSpan(Color.MAGENTA);\n\n                // Highlight it\n                editable.setSpan(span, matcher.start(), matcher.end(),\n                                 Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);\n            }\n\n            matcher.region(start, end).usePattern(QUOTED);\n            while (matcher.find())\n            {\n                ForegroundColorSpan span = new\n                    ForegroundColorSpan(Color.RED);\n\n                // Highlight it\n                editable.setSpan(span, matcher.start(), matcher.end(),\n                                 Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);\n            }\n\n            matcher.region(start, end).usePattern(HTML_COMMENT);\n            while (matcher.find())\n            {\n                ForegroundColorSpan span = new\n                    ForegroundColorSpan(Color.RED);\n\n                // Highlight it\n                editable.setSpan(span, matcher.start(), matcher.end(),\n                                 Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);\n            }\n            break;\n\n        case CSS_SYNTAX:\n            matcher = CSS_STYLES.matcher(editable);\n            matcher.region(start, end);\n            while (matcher.find())\n            {\n                ForegroundColorSpan span = new\n                    ForegroundColorSpan(Color.CYAN);\n\n                // Highlight it\n                editable.setSpan(span, matcher.start(), matcher.end(),\n                                 Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);\n            }\n\n            matcher.region(start, end).usePattern(CSS_HEX);\n            while (matcher.find())\n            {\n                ForegroundColorSpan span = new\n                    ForegroundColorSpan(Color.MAGENTA);\n\n                // Highlight it\n                editable.setSpan(span, matcher.start(), matcher.end(),\n                                 Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);\n            }\n\n            matcher.region(start, end).usePattern(CC_COMMENT);\n            while (matcher.find())\n            {\n                ForegroundColorSpan span = new\n                    ForegroundColorSpan(Color.RED);\n\n                // Highlight it\n                editable.setSpan(span, matcher.start(), matcher.end(),\n                                 Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);\n            }\n            break;\n\n        case ORG_SYNTAX:\n            matcher = ORG_HEADER.matcher(editable);\n            matcher.region(start, end);\n            while (matcher.find())\n            {\n                ForegroundColorSpan span = new\n                    ForegroundColorSpan(Color.BLUE);\n\n                // Highlight it\n                editable.setSpan(span, matcher.start(), matcher.end(),\n                                 Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);\n            }\n\n\n            matcher.region(start, end).usePattern(ORG_EMPH);\n            while (matcher.find())\n            {\n                ForegroundColorSpan span = new\n                    ForegroundColorSpan(Color.MAGENTA);\n\n                // Highlight it\n                editable.setSpan(span, matcher.start(), matcher.end(),\n                                 Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);\n            }\n\n            matcher.region(start, end).usePattern(ORG_LINK);\n            while (matcher.find())\n            {\n                ForegroundColorSpan span = new\n                    ForegroundColorSpan(Color.CYAN);\n\n                // Highlight it\n                editable.setSpan(span, matcher.start(), matcher.end(),\n                                 Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);\n            }\n\n            matcher.region(start, end).usePattern(ORG_COMMENT);\n            while (matcher.find())\n            {\n                ForegroundColorSpan span = new\n                    ForegroundColorSpan(Color.RED);\n\n                // Highlight it\n                editable.setSpan(span, matcher.start(), matcher.end(),\n                                 Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);\n            }\n            break;\n\n        case MD_SYNTAX:\n            matcher = MD_HEADER.matcher(editable);\n            matcher.region(start, end);\n            while (matcher.find())\n            {\n                ForegroundColorSpan span = new\n                    ForegroundColorSpan(Color.BLUE);\n\n                // Highlight it\n                editable.setSpan(span, matcher.start(), matcher.end(),\n                                 Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);\n            }\n\n            matcher.region(start, end).usePattern(MD_LINK);\n            while (matcher.find())\n            {\n                ForegroundColorSpan span = new\n                    ForegroundColorSpan(Color.CYAN);\n\n                // Highlight it\n                editable.setSpan(span, matcher.start(), matcher.end(),\n                                 Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);\n            }\n\n            matcher.region(start, end).usePattern(MD_EMPH);\n            while (matcher.find())\n            {\n                ForegroundColorSpan span = new\n                    ForegroundColorSpan(Color.MAGENTA);\n\n                // Highlight it\n                editable.setSpan(span, matcher.start(), matcher.end(),\n                                 Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);\n            }\n\n            matcher.region(start, end).usePattern(MD_CODE);\n            while (matcher.find())\n            {\n                ForegroundColorSpan span = new\n                    ForegroundColorSpan(Color.CYAN);\n\n                // Highlight it\n                editable.setSpan(span, matcher.start(), matcher.end(),\n                                 Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);\n            }\n            break;\n\n        case SH_SYNTAX:\n            matcher = KEYWORDS.matcher(editable);\n            matcher.region(start, end);\n            while (matcher.find())\n            {\n                ForegroundColorSpan span = new\n                    ForegroundColorSpan(Color.CYAN);\n\n                // Highlight it\n                editable.setSpan(span, matcher.start(), matcher.end(),\n                                 Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);\n            }\n\n            matcher.region(start, end).usePattern(NUMBER);\n            while (matcher.find())\n            {\n                ForegroundColorSpan span = new\n                    ForegroundColorSpan(Color.YELLOW);\n\n                // Highlight it\n                editable.setSpan(span, matcher.start(), matcher.end(),\n                                 Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);\n            }\n\n            matcher.region(start, end).usePattern(CONSTANT);\n            while (matcher.find())\n            {\n                ForegroundColorSpan span = new\n                    ForegroundColorSpan(Color.LTGRAY);\n\n                // Highlight it\n                editable.setSpan(span, matcher.start(), matcher.end(),\n                                 Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);\n            }\n\n            matcher.region(start, end).usePattern(SH_VAR);\n            while (matcher.find())\n            {\n                ForegroundColorSpan span = new\n                    ForegroundColorSpan(Color.MAGENTA);\n\n                // Highlight it\n                editable.setSpan(span, matcher.start(), matcher.end(),\n                                 Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);\n            }\n\n            matcher.region(start, end).usePattern(OPERATOR);\n            while (matcher.find())\n            {\n                ForegroundColorSpan span = new\n                    ForegroundColorSpan(Color.CYAN);\n\n                // Highlight it\n                editable.setSpan(span, matcher.start(), matcher.end(),\n                                 Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);\n            }\n\n            matcher.region(start, end).usePattern(QUOTED);\n            while (matcher.find())\n            {\n                ForegroundColorSpan span = new\n                    ForegroundColorSpan(Color.RED);\n\n                // Highlight it\n                editable.setSpan(span, matcher.start(), matcher.end(),\n                                 Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);\n            }\n\n            matcher.region(start, end).usePattern(SH_COMMENT);\n            while (matcher.find())\n            {\n                ForegroundColorSpan span = new\n                    ForegroundColorSpan(Color.RED);\n\n                // Highlight it\n                editable.setSpan(span, matcher.start(), matcher.end(),\n                                 Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);\n            }\n            break;\n\n        case DEF_SYNTAX:\n            matcher = KEYWORDS.matcher(editable);\n            matcher.region(start, end);\n            while (matcher.find())\n            {\n                ForegroundColorSpan span = new\n                    ForegroundColorSpan(Color.CYAN);\n\n                // Highlight it\n                editable.setSpan(span, matcher.start(), matcher.end(),\n                                 Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);\n            }\n\n            matcher.region(start, end).usePattern(TYPES);\n            while (matcher.find())\n            {\n                ForegroundColorSpan span = new\n                    ForegroundColorSpan(Color.MAGENTA);\n\n                // Highlight it\n                editable.setSpan(span, matcher.start(), matcher.end(),\n                                 Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);\n            }\n\n            matcher.region(start, end).usePattern(CLASS);\n            while (matcher.find())\n            {\n                ForegroundColorSpan span = new\n                    ForegroundColorSpan(Color.BLUE);\n\n                // Highlight it\n                editable.setSpan(span, matcher.start(), matcher.end(),\n                                 Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);\n            }\n\n            matcher.region(start, end).usePattern(NUMBER);\n            while (matcher.find())\n            {\n                ForegroundColorSpan span = new\n                    ForegroundColorSpan(Color.YELLOW);\n\n                // Highlight it\n                editable.setSpan(span, matcher.start(), matcher.end(),\n                                 Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);\n            }\n\n            matcher.region(start, end).usePattern(CONSTANT);\n            while (matcher.find())\n            {\n                ForegroundColorSpan span = new\n                    ForegroundColorSpan(Color.LTGRAY);\n\n                // Highlight it\n                editable.setSpan(span, matcher.start(), matcher.end(),\n                                 Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);\n            }\n\n            matcher.region(start, end).usePattern(QUOTED);\n            while (matcher.find())\n            {\n                ForegroundColorSpan span = new\n                    ForegroundColorSpan(Color.RED);\n\n                // Highlight it\n                editable.setSpan(span, matcher.start(), matcher.end(),\n                                 Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);\n            }\n            break;\n        }\n    }\n\n    // wordCountText\n    private void wordCountText()\n    {\n        int words = 0;\n        Matcher matcher = WORD_PATTERN.matcher(textView.getText());\n        while (matcher.find())\n        {\n            words++;\n        }\n\n        if (customView != null)\n        {\n            String string = String.format(Locale.getDefault(), \"%d\\n%d\",\n                                          words, textView.length());\n            customView.setText(string);\n        }\n    }\n\n    // onActionModeStarted\n    @Override\n    public void onActionModeStarted(ActionMode mode)\n    {\n        super.onActionModeStarted(mode);\n\n        // If there's a file\n        if (file != null)\n        {\n            // Get the mime type\n            String type = FileUtils.getMimeType(file);\n            // If the type is not text/plain\n            if (!TEXT_PLAIN.equals(type))\n            {\n                // Get the start and end of the selection\n                int start = textView.getSelectionStart();\n                int end = textView.getSelectionEnd();\n                // And the text\n                CharSequence text = textView.getText();\n\n                // Get a pattern and a matcher for delimiter\n                // characters\n                Matcher matcher = PATTERN_CHARS.matcher(text);\n\n                // Find the first match after the end of the selection\n                if (matcher.find(end))\n                {\n                    // Update the selection end\n                    end = matcher.start();\n\n                    // Get the matched char\n                    char c = text.charAt(end);\n\n                    // Check for opening brackets\n                    if (BRACKET_CHARS.indexOf(c) == -1)\n                    {\n                        switch (c)\n                        {\n                            // Check for close brackets and look for\n                            // the open brackets\n                        case ')':\n                            c = '(';\n                            break;\n\n                        case ']':\n                            c = '[';\n                            break;\n\n                        case '}':\n                            c = '{';\n                            break;\n\n                        case '>':\n                            c = '<';\n                            break;\n                        }\n\n                        String string = text.toString();\n                        // Do reverse search\n                        start = string.lastIndexOf(c, start) + 1;\n\n                        // Check for included newline\n                        if (start > string.lastIndexOf('\\n', end))\n                            // Update selection\n                            textView.setSelection(start, end);\n                    }\n                }\n            }\n        }\n    }\n\n    // checkMode\n    private void checkMode(CharSequence text)\n    {\n        boolean change = false;\n\n        CharSequence first = text.subSequence\n            (0, Math.min(text.length(), FIRST_SIZE));\n        CharSequence last = text.subSequence\n            (Math.max(0, text.length() - LAST_SIZE), text.length());\n        for (CharSequence sequence: new CharSequence[]{first, last})\n        {\n            Matcher matcher = MODE_PATTERN.matcher(sequence);\n            if (matcher.find())\n            {\n                matcher.region(matcher.start(1), matcher.end(1));\n                matcher.usePattern(OPTION_PATTERN);\n                while (matcher.find())\n                {\n                    boolean no = \"no\".equals(matcher.group(2));\n\n                    if (\"vw\".equals(matcher.group(3)))\n                    {\n                        if (view == no)\n                        {\n                            view = !no;\n                            change = true;\n                        }\n                    }\n\n                    else if (\"ww\".equals(matcher.group(3)))\n                    {\n                        if (wrap == no)\n                        {\n                            wrap = !no;\n                            change = true;\n                        }\n                    }\n\n                    else if (\"sg\".equals(matcher.group(3)))\n                    {\n                        if (suggest == no)\n                        {\n                            suggest = !no;\n                            change = true;\n                        }\n                    }\n\n                    else if (\"hs\".equals(matcher.group(3)))\n                    {\n                        if (highlight == no)\n                        {\n                            highlight = !no;\n                            checkHighlight();\n                        }\n                    }\n\n                    else if (\"th\".equals(matcher.group(3)))\n                    {\n                        if (\":l\".equals(matcher.group(4)))\n                        {\n                            if (theme != LIGHT)\n                            {\n                                theme = LIGHT;\n                                change = true;\n                            }\n                        }\n\n                        else if (\":d\".equals(matcher.group(4)))\n                        {\n                            if (theme != DARK)\n                            {\n                                theme = DARK;\n                                change = true;\n                            }\n                        }\n\n                        else if (\":s\".equals(matcher.group(4)))\n                        {\n                            if (theme != SYSTEM)\n                            {\n                                theme = SYSTEM;\n                                change = true;\n                            }\n                        }\n\n                        else if (\":w\".equals(matcher.group(4)))\n                        {\n                            if (theme != WHITE)\n                            {\n                                theme = WHITE;\n                                change = true;\n                            }\n                        }\n\n                        else if (\":b\".equals(matcher.group(4)))\n                        {\n                            if (theme != BLACK)\n                            {\n                                theme = BLACK;\n                                change = true;\n                            }\n                        }\n\n                        else if (\":r\".equals(matcher.group(4)))\n                        {\n                            if (theme != RETRO)\n                            {\n                                theme = RETRO;\n                                change = true;\n                            }\n                        }\n                    }\n\n                    else if (\"ts\".equals(matcher.group(3)))\n                    {\n                        if (\":l\".equals(matcher.group(4)))\n                        {\n                            if (size != LARGE)\n                            {\n                                size = LARGE;\n                                textView.setTextSize(size);\n                            }\n                        }\n\n                        else if (\":m\".equals(matcher.group(4)))\n                        {\n                            if (size != MEDIUM)\n                            {\n                                size = MEDIUM;\n                                textView.setTextSize(size);\n                            }\n                        }\n\n                        else if (\":s\".equals(matcher.group(4)))\n                        {\n                            if (size != SMALL)\n                            {\n                                size = SMALL;\n                                textView.setTextSize(size);\n                            }\n                        }\n                    }\n\n                    else if (\"tf\".equals(matcher.group(3)))\n                    {\n                        if (\":m\".equals(matcher.group(4)))\n                        {\n                            if (type != MONO)\n                            {\n                                type = MONO;\n                                textView.setTypeface(Typeface.MONOSPACE);\n                            }\n                        }\n\n                        else if (\":p\".equals(matcher.group(4)))\n                        {\n                            if (type != NORMAL)\n                            {\n                                type = NORMAL;\n                                textView.setTypeface(Typeface.DEFAULT);\n                            }\n                        }\n\n                        else if (\":s\".equals(matcher.group(4)))\n                        {\n                            if (type != SERIF)\n                            {\n                                type = SERIF;\n                                textView.setTypeface(Typeface.SERIF);\n                            }\n                        }\n                    }\n\n                    else if (\"cs\".equals(matcher.group(3)))\n                    {\n                        if (\":u\".equals(matcher.group(4)))\n                        {\n                            match = UTF_8;\n                            getActionBar().setSubtitle(match);\n                        }\n                    }\n                }\n            }\n        }\n\n        if (change)\n            recreate(this);\n    }\n\n    // loadText\n    private void loadText(CharSequence text)\n    {\n        if (textView != null)\n            textView.setText(text);\n\n        changed = false;\n\n        // Check for saved position\n        if (pathMap.containsKey(path))\n            textView.postDelayed(() ->\n                                 scrollView.smoothScrollTo\n                                 (0, pathMap.get(path)),\n                                 POSITION_DELAY);\n        else\n            textView.postDelayed(() ->\n                                 scrollView.smoothScrollTo(0, 0),\n                                 POSITION_DELAY);\n        // Check mode\n        checkMode(text);\n\n        // Check highlighting\n        checkHighlight();\n\n        // Set read only\n        if (view)\n        {\n            textView.setRawInputType(InputType.TYPE_NULL);\n            textView.setTextIsSelectable(true);\n\n            // Update boolean\n            edit = false;\n        }\n\n        else\n        {\n            // Set editable with or without suggestions\n            if (suggest)\n                textView.setInputType(InputType.TYPE_CLASS_TEXT |\n                                      InputType.TYPE_TEXT_FLAG_MULTI_LINE);\n            else\n                textView.setInputType(InputType.TYPE_CLASS_TEXT |\n                                      InputType.TYPE_TEXT_FLAG_MULTI_LINE |\n                                      InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);\n            // Update boolean\n            edit = true;\n        }\n\n        // Dismiss keyboard\n        textView.clearFocus();\n\n        // Update menu\n        invalidateOptionsMenu();\n    }\n\n    // QueryTextListener\n    private class QueryTextListener\n        implements SearchView.OnQueryTextListener\n    {\n        private BackgroundColorSpan span = new\n            BackgroundColorSpan(Color.YELLOW);\n        private Editable editable;\n        private Matcher matcher;\n        private Pattern pattern;\n        private int index;\n        private int height;\n\n        // onQueryTextChange\n        @Override\n        @SuppressWarnings(\"deprecation\")\n        public boolean onQueryTextChange(String newText)\n        {\n            // Use regex search and spannable for highlighting\n            height = scrollView.getHeight();\n            editable = textView.getEditableText();\n\n            // Reset the index and clear highlighting\n            if (newText.length() == 0)\n            {\n                index = 0;\n                editable.removeSpan(span);\n                return false;\n            }\n\n            // Check pattern\n            try\n            {\n                pattern = Pattern.compile(newText, Pattern.MULTILINE);\n                matcher = pattern.matcher(editable);\n            }\n\n            catch (Exception e)\n            {\n                return false;\n            }\n\n            // Find text\n            if (matcher.find(index))\n            {\n                // Get index\n                index = matcher.start();\n\n                // Check layout\n                if (textView.getLayout() == null)\n                    return false;\n\n                // Get text position\n                int line = textView.getLayout().getLineForOffset(index);\n                int pos = textView.getLayout().getLineBaseline(line);\n\n                // Scroll to it\n                scrollView.smoothScrollTo(0, pos - height / 2);\n\n                // Highlight it\n                editable.setSpan(span, matcher.start(), matcher.end(),\n                                 Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);\n            }\n\n            else\n                index = 0;\n\n            return true;\n        }\n\n        // onQueryTextSubmit\n        @Override\n        public boolean onQueryTextSubmit(String query)\n        {\n            // Check matcher\n            if (matcher == null)\n                return false;\n\n            // Find next text\n            if (matcher.find())\n            {\n                // Get index\n                index = matcher.start();\n\n                // Get text position\n                int line = textView.getLayout().getLineForOffset(index);\n                int pos = textView.getLayout().getLineBaseline(line);\n\n                // Scroll to it\n                scrollView.smoothScrollTo(0, pos - height / 2);\n\n                // Highlight it\n                editable.setSpan(span, matcher.start(), matcher.end(),\n                                 Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);\n            }\n\n            else\n            {\n                matcher.reset();\n                index = 0;\n            }\n\n            return true;\n        }\n    }\n\n    // readFile\n    private CharSequence readFile(File file)\n    {\n        StringBuilder text = new StringBuilder();\n        // Open file\n        try (BufferedReader reader = new BufferedReader\n             (new InputStreamReader\n              (new BufferedInputStream(new FileInputStream(file)))))\n        {\n            String line;\n            while ((line = reader.readLine()) != null)\n            {\n                text.append(line);\n                text.append(System.getProperty(\"line.separator\"));\n            }\n\n            return text;\n        }\n\n        catch (Exception e)\n        {\n            e.printStackTrace();\n        }\n\n        return text;\n    }\n\n    // ScaleListener\n    private class ScaleListener\n        extends ScaleGestureDetector.SimpleOnScaleGestureListener\n    {\n        // onScale\n        @Override\n        public boolean onScale(ScaleGestureDetector detector)\n        {\n            size *= Math.cbrt(detector.getScaleFactor());\n            size = Math.max(TINY, Math.min(size, HUGE));\n            textView.setTextSize(size);\n            invalidateOptionsMenu();\n\n            return true;\n        }\n    }\n\n    private void doFind(Context context, String search)\n    {\n        List<File> matchList = new ArrayList<>();\n        List<File> entries = new ArrayList<>();\n\n        // Get entry list\n        for (String path : pathMap.keySet())\n        {\n            File entry = new File(path);\n            entries.add(entry);\n        }\n\n        executor.execute(() ->\n        {\n            Pattern pattern = null;\n\n            try\n            {\n                // Compile search pattern\n                pattern = Pattern.compile(search, Pattern.MULTILINE);\n            }\n\n            catch (Exception e) {}\n\n            // Check the entries\n            for (File file : entries)\n            {\n                CharSequence content = readFile(file);\n                Matcher matcher = pattern.matcher(content);\n                if (matcher.find())\n                    matchList.add(file);\n            }\n\n            runOnUiThread(() ->\n            {\n                // Build dialog\n                AlertDialog.Builder builder = new AlertDialog.Builder(context);\n                builder.setTitle(R.string.findAll);\n\n                // If found populate dialog\n                if (!matchList.isEmpty())\n                {\n                    List<String> choiceList = new ArrayList<>();\n                    for (File file : matchList)\n                    {\n                        // Remove path prefix\n                        String path = file.getPath();\n                        String name =\n                            path.replaceFirst(Environment\n                                              .getExternalStorageDirectory()\n                                              .getPath() + File.separator, \"\");\n\n                        choiceList.add(name);\n                    }\n\n                    String[] choices = choiceList.toArray(new String[0]);\n                    builder.setItems(choices, (dialog, which) ->\n                    {\n                        File file = matchList.get(which);\n                        Uri uri = Uri.fromFile(file);\n                        // Open the entry chosen\n                        readFile(uri);\n\n                        // Put the search text back - why it\n                        // disappears I have no idea or why I have to\n                        // do it after a delay\n                        searchView.postDelayed(() ->\n                            searchView.setQuery(search, false),\n                                               FIND_DELAY);\n                    });\n                }\n\n                builder.setNegativeButton(android.R.string.cancel, null);\n                builder.show();\n            });\n        });\n    }\n\n    // doRead\n    private void doRead(Context context, Uri uri)\n    {\n        StringBuilder stringBuilder = new StringBuilder();\n\n        // Default UTF-8\n        if (match == null)\n        {\n            match = UTF_8;\n            getActionBar().setSubtitle(match);\n        }\n\n        executor.execute(() ->\n        {\n            try (BufferedInputStream in = new BufferedInputStream\n                 (getContentResolver().openInputStream(uri)))\n            {\n                // Create reader\n                BufferedReader reader = null;\n                if (match.equals(getString(R.string.detect)))\n                {\n                    // Detect charset, using UTF-8 hint\n                    CharsetMatch charsetMatch = new\n                        CharsetDetector().setDeclaredEncoding(UTF_8)\n                        .setText(in).detect();\n\n                    if (charsetMatch != null)\n                    {\n                        match = charsetMatch.getName();\n                        runOnUiThread(() ->\n                            getActionBar().setSubtitle(match));\n                        reader = new BufferedReader(charsetMatch.getReader());\n                    }\n\n                    else\n                        reader = new BufferedReader\n                            (new InputStreamReader(in));\n\n                    if (BuildConfig.DEBUG && match != null)\n                        Log.d(TAG, \"Charset \" + match);\n                }\n\n                else\n                     reader = new BufferedReader\n                         (new InputStreamReader(in, match));\n\n                String line;\n                while ((line = reader.readLine()) != null)\n                {\n                    stringBuilder.append(line);\n                    stringBuilder.append(System.getProperty(\"line.separator\"));\n                }\n            }\n\n            catch (Exception e)\n            {\n                runOnUiThread(() ->\n                    alertDialog(context, R.string.appName,\n                                e.getMessage(),\n                                R.string.ok));\n                e.printStackTrace();\n            }\n\n            runOnUiThread(() -> loadText(stringBuilder));\n        });\n    }\n}\n"
  },
  {
    "path": "src/main/java/org/billthefarmer/editor/FileAdapter.java",
    "content": "////////////////////////////////////////////////////////////////////////////////\n//\n//  Editor - Text editor for Android\n//\n//  Copyright © 2017  Bill Farmer\n//\n//  This program is free software: you can redistribute it and/or modify\n//  it under the terms of the GNU General Public License as published by\n//  the Free Software Foundation, either version 3 of the License, or\n//  (at your option) any later version.\n//\n//  This program is distributed in the hope that it will be useful,\n//  but WITHOUT ANY WARRANTY; without even the implied warranty of\n//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//  GNU General Public License for more details.\n//\n//  You should have received a copy of the GNU General Public License\n//  along with this program.  If not, see <http://www.gnu.org/licenses/>.\n//\n////////////////////////////////////////////////////////////////////////////////\n\npackage org.billthefarmer.editor;\n\nimport android.content.Context;\nimport android.content.res.TypedArray;\nimport android.os.Environment;\nimport android.util.Log;\nimport android.view.LayoutInflater;\nimport android.view.View;\nimport android.view.ViewGroup;\nimport android.widget.BaseAdapter;\nimport android.widget.TextView;\n\nimport java.io.File;\nimport java.util.List;\n\n// FileAdapter class\npublic class FileAdapter extends BaseAdapter\n{\n    private final static String TAG = \"FileAdapter\";\n\n    private final static String ROOT = \"/\";\n\n    private final static String IMAGE_SVG = \"image/svg\";\n\n    private final static String IMAGE = \"image\";\n    private final static String AUDIO = \"audio\";\n    private final static String VIDEO = \"video\";\n\n    private final static String APPLICATION = \"application\";\n\n    private final static long TOO_LARGE = 524288;\n\n    private LayoutInflater inflater;\n    private List<File> files;\n\n    private int fileId;\n    private int audioId;\n    private int imageId;\n    private int videoId;\n    private int folderId;\n    private int parentId;\n    private int externalId;\n    private int applicationId;\n\n    // Constructor\n    public FileAdapter(Context context, List<File> files)\n    {\n        inflater = LayoutInflater.from(context);\n        this.files = files;\n\n        final TypedArray typedArray =\n            context.obtainStyledAttributes(R.styleable.Editor);\n\n        if (typedArray.hasValue(R.styleable.Editor_folder))\n            folderId =\n                typedArray.getResourceId(R.styleable.Editor_folder, 0);\n\n        if (typedArray.hasValue(R.styleable.Editor_parent))\n            parentId =\n                typedArray.getResourceId(R.styleable.Editor_parent, 0);\n\n        if (typedArray.hasValue(R.styleable.Editor_file))\n            fileId =\n                typedArray.getResourceId(R.styleable.Editor_file, 0);\n\n        if (typedArray.hasValue(R.styleable.Editor_audio))\n            audioId =\n                typedArray.getResourceId(R.styleable.Editor_audio, 0);\n\n        if (typedArray.hasValue(R.styleable.Editor_image))\n            imageId =\n                typedArray.getResourceId(R.styleable.Editor_image, 0);\n\n        if (typedArray.hasValue(R.styleable.Editor_video))\n            videoId =\n                typedArray.getResourceId(R.styleable.Editor_video, 0);\n\n        if (typedArray.hasValue(R.styleable.Editor_external))\n            externalId =\n                typedArray.getResourceId(R.styleable.Editor_external, 0);\n\n        if (typedArray.hasValue(R.styleable.Editor_application))\n            applicationId =\n                typedArray.getResourceId(R.styleable.Editor_application, 0);\n\n        typedArray.recycle();\n    }\n\n    @Override\n    public int getCount()\n    {\n        return files.size();\n    }\n\n    @Override\n    public Object getItem(int position)\n    {\n        return null;\n    }\n\n    @Override\n    public long getItemId(int position)\n    {\n        return position;\n    }\n\n    // Create a new View for each item referenced by the adapter\n    @Override\n    public View getView(int position, View convertView, ViewGroup parent)\n    {\n        // Create a new view\n        if (convertView == null)\n            convertView = inflater.inflate(R.layout.file, parent, false);\n\n        // Find the views\n        TextView name = convertView.findViewById(R.id.name);\n        File file = files.get(position);\n\n        if (name != null)\n        {\n            if (file.getParentFile() == null)\n                name.setText(ROOT);\n\n            else\n                name.setText(file.getName());\n\n            name.setEnabled(true);\n            name.setClickable(false);\n\n            if (file.isDirectory())\n            {\n                if (position == 0)\n                    name.setCompoundDrawablesWithIntrinsicBounds(parentId,\n                                                                 0, 0, 0);\n                else\n                    name.setCompoundDrawablesWithIntrinsicBounds(folderId,\n                                                                 0, 0, 0);\n            }\n\n            else\n            {\n                // Get the mime type\n                String type = FileUtils.getMimeType(file);\n                if (type != null && type.startsWith(IMAGE_SVG))\n                    name.setCompoundDrawablesWithIntrinsicBounds(imageId,\n                                                                 0, 0, 0);\n\n                else if (type != null && type.startsWith(IMAGE))\n                {\n                    name.setEnabled(false);\n                    name.setClickable(true);\n                    name.setCompoundDrawablesWithIntrinsicBounds(imageId,\n                                                                 0, 0, 0);\n                }\n\n                else if (type != null && type.startsWith(AUDIO))\n                {\n                    name.setEnabled(false);\n                    name.setClickable(true);\n                    name.setCompoundDrawablesWithIntrinsicBounds(audioId,\n                                                                 0, 0, 0);\n                }\n\n                else if (type != null && type.startsWith(VIDEO))\n                {\n                    name.setEnabled(false);\n                    name.setClickable(true);\n                    name.setCompoundDrawablesWithIntrinsicBounds(videoId,\n                                                                 0, 0, 0);\n                }\n\n                else if (type != null && type.startsWith(APPLICATION))\n                    name.setCompoundDrawablesWithIntrinsicBounds(applicationId,\n                                                                 0, 0, 0);\n\n                else\n                    name.setCompoundDrawablesWithIntrinsicBounds(fileId,\n                                                                 0, 0, 0);\n            }\n\n            // Too large\n            if (file.length() > TOO_LARGE)\n            {\n                name.setEnabled(false);\n                name.setClickable(true);\n            }\n        }\n\n        return convertView;\n    }\n}\n"
  },
  {
    "path": "src/main/java/org/billthefarmer/editor/FileUtils.java",
    "content": "/*\n * Copyright (C) 2018 OpenIntents.org\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.billthefarmer.editor;\n\nimport android.content.ContentResolver;\nimport android.content.ContentUris;\nimport android.content.Context;\nimport android.content.Intent;\nimport android.database.Cursor;\nimport android.database.DatabaseUtils;\nimport android.graphics.Bitmap;\nimport android.net.Uri;\nimport android.os.Build;\nimport android.os.Environment;\nimport android.provider.DocumentsContract;\nimport android.provider.MediaStore;\nimport android.provider.OpenableColumns;\nimport android.util.Log;\nimport android.webkit.MimeTypeMap;\n\nimport java.io.File;\nimport java.io.FileFilter;\nimport java.text.DecimalFormat;\nimport java.util.Comparator;\nimport java.util.List;\nimport java.util.Locale;\n\n/**\n * @author Peli\n * @author paulburke (ipaulpro)\n * @author Bill Farmer (billthefarmer)\n * @version 2017-06-22\n */\npublic class FileUtils\n{\n    /**\n     * TAG for log messages.\n     */\n    private static final String TAG = \"FileUtils\";\n    // pattern\n    /**\n     * File and folder comparator. TODO Expose sorting option method\n     *\n     * @author paulburke\n     */\n    public static Comparator<File> sComparator = (f1, f2) ->\n    {\n        // Sort alphabetically by lower case, which is much cleaner\n        return f1.getName().toLowerCase(Locale.getDefault())\n        .compareTo(f2.getName().toLowerCase(Locale.getDefault()));\n    };\n\n    public static final String MIME_TYPE_AUDIO = \"audio/*\";\n    public static final String MIME_TYPE_TEXT = \"text/*\";\n    public static final String MIME_TYPE_IMAGE = \"image/*\";\n    public static final String MIME_TYPE_VIDEO = \"video/*\";\n    public static final String MIME_TYPE_APP = \"application/*\";\n\n    public static final String HIDDEN_PREFIX = \".\";\n    /**\n     * File (not directories) filter.\n     *\n     * @author paulburke\n     */\n    public static FileFilter sFileFilter = file ->\n    {\n        final String fileName = file.getName();\n        // Return files only (not directories) and skip hidden files\n        return file.isFile() && !fileName.startsWith(HIDDEN_PREFIX);\n    };\n    /**\n     * Folder (directories) filter.\n     *\n     * @author paulburke\n     */\n    public static FileFilter sDirFilter = file ->\n    {\n        final String fileName = file.getName();\n        // Return directories only and skip hidden directories\n        return file.isDirectory() && !fileName.startsWith(HIDDEN_PREFIX);\n    };\n\n    private FileUtils()\n    {\n    } // private constructor to enforce Singleton\n\n    /**\n     * Gets the extension of a file name, like \".png\" or \".jpg\".\n     *\n     * @param uri\n     * @return Extension including the dot(\".\"); \"\" if there is no\n     * extension; null if uri was null.\n     */\n    public static String getExtension(String uri)\n    {\n        if (uri == null)\n        {\n            return null;\n        }\n\n        int dot = uri.lastIndexOf(\".\");\n        if (dot >= 0)\n        {\n            return uri.substring(dot);\n        }\n        else\n        {\n            // No extension.\n            return \"\";\n        }\n    }\n\n    /**\n     * @return Whether the URI is a local one.\n     */\n    public static boolean isLocal(String url)\n    {\n        return url != null && !url.startsWith(\"http://\") &&\n               !url.startsWith(\"https://\");\n    }\n\n    /**\n     * @return True if Uri is a MediaStore Uri.\n     * @author paulburke\n     */\n    public static boolean isMediaUri(Uri uri)\n    {\n        return \"media\".equalsIgnoreCase(uri.getAuthority());\n    }\n\n    /**\n     * Convert File into Uri.\n     *\n     * @param file\n     * @return uri\n     */\n    public static Uri getUri(File file)\n    {\n        return (file != null) ? Uri.fromFile(file) : null;\n    }\n\n    /**\n     * Returns the path only (without file name).\n     *\n     * @param file\n     * @return\n     */\n    public static File getPathWithoutFilename(File file)\n    {\n        if (file != null)\n        {\n            if (file.isDirectory())\n            {\n                // no file to be split off. Return everything\n                return file;\n            }\n            else\n            {\n                String filename = file.getName();\n                String filepath = file.getAbsolutePath();\n\n                // Construct path without file name.\n                String pathwithoutname = filepath.substring(0,\n                                         filepath.length() - filename.length());\n                if (pathwithoutname.endsWith(File.separator))\n                {\n                    pathwithoutname = pathwithoutname\n                        .substring(0, pathwithoutname.length() - 1);\n                }\n                return new File(pathwithoutname);\n            }\n        }\n        return null;\n    }\n\n    /**\n     * @return The MIME type for the given file.\n     */\n    public static String getMimeType(File file)\n    {\n\n        String extension =\n            getExtension(file.getName()).toLowerCase(Locale.getDefault());\n\n        if (extension.length() > 0)\n            return MimeTypeMap.getSingleton()\n                   .getMimeTypeFromExtension(extension.substring(1));\n\n        return \"application/octet-stream\";\n    }\n\n    /**\n     * @return The MIME type for the give Uri.\n     */\n    public static String getMimeType(Context context, Uri uri)\n    {\n        File file = new File(getPath(context, uri));\n        return getMimeType(file);\n    }\n\n    /**\n     * @param uri The Uri to check.\n     * @return Whether the Uri authority is ExternalStorageProvider.\n     * @author paulburke\n     */\n    public static boolean isExternalStorageDocument(Uri uri)\n    {\n        return \"com.android.externalstorage.documents\"\n               .equals(uri.getAuthority());\n    }\n\n    /**\n     * @param uri The Uri to check.\n     * @return Whether the Uri authority is DownloadsProvider.\n     * @author paulburke\n     */\n    public static boolean isDownloadsDocument(Uri uri)\n    {\n        return \"com.android.providers.downloads.documents\"\n               .equals(uri.getAuthority());\n    }\n\n    /**\n     * @param uri The Uri to check.\n     * @return Whether the Uri authority is MediaProvider.\n     * @author paulburke\n     */\n    public static boolean isMediaDocument(Uri uri)\n    {\n        return \"com.android.providers.media.documents\"\n               .equals(uri.getAuthority());\n    }\n\n    /**\n     * @param uri The Uri to check.\n     * @return Whether the Uri authority is Google Photos.\n     */\n    public static boolean isGooglePhotosUri(Uri uri)\n    {\n        return \"com.google.android.apps.photos.content\"\n               .equals(uri.getAuthority());\n    }\n\n    /**\n     * @param uri The Uri to match.\n     * @return The file path from the FileProvider Uri.\n     * @author billthefarmer\n     */\n    public static String fileProviderPath(Uri uri)\n    {\n        List<String> uriList = uri.getPathSegments();\n\n        if (BuildConfig.DEBUG)\n        {\n            Log.d(TAG, \"Uri: \" + uri);\n            Log.d(TAG, \"Path: \" + uriList);\n        }\n\n        List<String> segments =\n            uriList.subList(1, uriList.size());\n\n        // Try root path\n        if (uriList.size() > 3)\n        {\n            StringBuilder path = new StringBuilder();\n            for (String segment : segments)\n            {\n                path.append(File.separator);\n                path.append(segment);\n            }\n\n            if (BuildConfig.DEBUG)\n                Log.d(TAG, \"Path: \" + path);\n\n            File file = new File(path.toString());\n            if (file.isFile())\n                return path.toString();\n        }\n\n        // Try external storage path\n        if (uriList.size() > 1)\n        {\n            StringBuilder path = new StringBuilder();\n            path.append(Environment.getExternalStorageDirectory());\n            for (String segment : segments)\n            {\n                path.append(File.separator);\n                path.append(segment);\n            }\n\n            if (BuildConfig.DEBUG)\n                Log.d(TAG, \"Path: \" + path);\n\n            File file = new File(path.toString());\n            if (file.isFile())\n                return path.toString();\n        }\n\n        return null;\n    }\n\n    /**\n     * Get the display name for this Uri. This is useful for\n     * MediaStore Uris, and other file-based ContentProviders.\n     *\n     * @param context       The context.\n     * @param uri           The Uri to query.\n     * @param selection     (Optional) Filter used in the query.\n     * @param selectionArgs (Optional) Selection arguments used in the\n     *                      query.\n     * @return The display name of the file referred to by the Uri\n     * @author Bill Farmer\n     */\n    public static String getDisplayName(Context context, Uri uri,\n                                        String selection,\n                                        String[] selectionArgs)\n    {\n        final String column = OpenableColumns.DISPLAY_NAME;\n        final String[] projection =\n            {\n                column\n            };\n\n        try (Cursor cursor = context.getContentResolver()\n             .query(uri, projection, selection, selectionArgs, null))\n        {\n            if (cursor != null && cursor.moveToFirst())\n            {\n                if (BuildConfig.DEBUG)\n                    DatabaseUtils.dumpCursor(cursor);\n\n                final int column_index = cursor.getColumnIndex(column);\n                if (column_index >= 0)\n                    return cursor.getString(column_index);\n            }\n        }\n\n        catch (Exception e) {}\n\n        return null;\n    }\n\n    /**\n     * Get the size for this Uri. This is useful for MediaStore Uris,\n     * and other file-based ContentProviders.\n     *\n     * @param context       The context.\n     * @param uri           The Uri to query.\n     * @param selection     (Optional) Filter used in the query.\n     * @param selectionArgs (Optional) Selection arguments used in the\n     *                      query.\n     * @return The size of the file referred to by the Uri\n     * @author Bill Farmer\n     */\n    public static long getSize(Context context, Uri uri,\n                              String selection,\n                              String[] selectionArgs)\n    {\n        final String column = OpenableColumns.SIZE;\n        final String[] projection =\n            {\n                column\n            };\n\n        try (Cursor cursor = context.getContentResolver()\n             .query(uri, projection, selection, selectionArgs, null))\n        {\n            if (cursor != null && cursor.moveToFirst())\n            {\n                if (BuildConfig.DEBUG)\n                    DatabaseUtils.dumpCursor(cursor);\n\n                final int column_index = cursor.getColumnIndex(column);\n                if (column_index >= 0)\n                    return cursor.getLong(column_index);\n            }\n        }\n\n        catch (Exception e) {}\n\n        return 0;\n    }\n\n    /**\n     * Get the value of the data column for this Uri. This is useful for\n     * MediaStore Uris, and other file-based ContentProviders.\n     *\n     * @param context       The context.\n     * @param uri           The Uri to query.\n     * @param selection     (Optional) Filter used in the query.\n     * @param selectionArgs (Optional) Selection arguments used in the\n     *                      query.\n     * @return The value of the _data column, which is typically a\n     * file path.\n     * @author paulburke\n     */\n    public static String getDataColumn(Context context, Uri uri,\n                                       String selection,\n                                       String[] selectionArgs)\n    {\n        final String column = MediaStore.MediaColumns.DATA;\n        final String[] projection =\n        {\n            column\n        };\n\n        try (Cursor cursor = context.getContentResolver()\n             .query(uri, projection, selection, selectionArgs, null))\n        {\n            if (cursor != null && cursor.moveToFirst())\n            {\n                if (BuildConfig.DEBUG)\n                    DatabaseUtils.dumpCursor(cursor);\n\n                final int column_index = cursor.getColumnIndex(column);\n                if (column_index >= 0)\n                    return cursor.getString(column_index);\n            }\n        }\n\n        catch (Exception e) {}\n\n        return null;\n    }\n\n    /**\n     * Get a file path from a Uri. This will get the the path for\n     * Storage Access Framework Documents, as well as the _data field\n     * for the MediaStore and other file-based ContentProviders.<br>\n     * <br>\n     * Callers should check whether the path is local before assuming\n     * it represents a local file.\n     *\n     * @param context The context.\n     * @param uri     The Uri to query.\n     * @author paulburke\n     * @see #isLocal(String)\n     * @see #getFile(Context, Uri)\n     */\n    public static String getPath(final Context context, final Uri uri)\n    {\n\n        if (BuildConfig.DEBUG)\n            Log.d(TAG, \"File: \" +\n                  \"Authority: \" + uri.getAuthority() +\n                  \", Fragment: \" + uri.getFragment() +\n                  \", Port: \" + uri.getPort() +\n                  \", Query: \" + uri.getQuery() +\n                  \", Scheme: \" + uri.getScheme() +\n                  \", Host: \" + uri.getHost() +\n                  \", Segments: \" + uri.getPathSegments().toString()\n                 );\n\n        // DocumentProvider\n        if (DocumentsContract.isDocumentUri(context, uri))\n        {\n            // ExternalStorageProvider\n            if (isExternalStorageDocument(uri))\n            {\n                final List<String> segments = uri.getPathSegments();\n                final String docId = DocumentsContract.getDocumentId(uri);\n                final String[] split = docId.split(\":\");\n                final String type = split[0];\n                final String id = split[1];\n\n                if (BuildConfig.DEBUG)\n                    Log.d(TAG, \"Segments: \" + segments);\n\n                if (BuildConfig.DEBUG)\n                    Log.d(TAG, \"DocId: \" + docId);\n\n                if (\"primary\".equalsIgnoreCase(type))\n                {\n                    return Environment.getExternalStorageDirectory() +\n                        File.separator + id;\n                }\n                else if (\"home\".equalsIgnoreCase(type))\n                {\n                    return Environment .getExternalStorageDirectory() +\n                        \"/Documents/\" + id;\n                }\n                else if (type != null && type.matches(\"[0-9A-Z]{4}-[0-9A-Z]{4}\"))\n                {\n                    List<String> storage =\n                        Uri.fromFile(Environment.getExternalStorageDirectory())\n                        .getPathSegments();\n\n                    return File.separator + storage.get(0) + File.separator +\n                        type + File.separator + id;\n                }\n                else if (\"document\".equalsIgnoreCase(segments.get(0)))\n                {\n                    return Environment .getExternalStorageDirectory() +\n                        File.separator + id;\n                }\n\n                // TODO handle non-primary volumes\n            }\n            // DownloadsProvider\n            else if (isDownloadsDocument(uri))\n            {\n                // Check for non-numeric id\n                try\n                {\n                    final String id = DocumentsContract.getDocumentId(uri);\n                    final Uri contentUri =\n                        ContentUris\n                        .withAppendedId(Uri.parse(\"content://downloads/public_downloads\"),\n                                        Long.valueOf(id));\n\n                    return getDataColumn(context, contentUri, null, null);\n                }\n\n\n                // Id not a number\n                catch (Exception e)\n                {\n                    return getDataColumn(context, uri, null, null);\n                }\n            }\n            // MediaProvider\n            else if (isMediaDocument(uri))\n            {\n                final String docId = DocumentsContract.getDocumentId(uri);\n                final String[] split = docId.split(\":\");\n                final String type = split[0];\n                final String id = split[1];\n\n                Uri contentUri = null;\n                if (\"image\".equals(type))\n                {\n                    contentUri =\n                        MediaStore.Images.Media.EXTERNAL_CONTENT_URI;\n                }\n                else if (\"video\".equals(type))\n                {\n                    contentUri =\n                        MediaStore.Video.Media.EXTERNAL_CONTENT_URI;\n                }\n                else if (\"audio\".equals(type))\n                {\n                    contentUri =\n                        MediaStore.Audio.Media.EXTERNAL_CONTENT_URI;\n                }\n\n                final String selection = \"_id=?\";\n                final String[] selectionArgs = new String[]\n                {\n                    id\n                };\n\n                return getDataColumn(context, contentUri,\n                                     selection, selectionArgs);\n            }\n        }\n        // MediaStore (and general)\n        else if (\"content\".equalsIgnoreCase(uri.getScheme()))\n        {\n            // Return the remote address\n            if (isGooglePhotosUri(uri))\n                return uri.getLastPathSegment();\n\n            // Return ContentProvider path\n            String path = getDataColumn(context, uri, null, null);\n            if (path != null)\n                return path;\n\n            // Return FileProvider path\n            return fileProviderPath(uri);\n        }\n        // File\n        else if (\"file\".equalsIgnoreCase(uri.getScheme()))\n        {\n            return uri.getPath();\n        }\n\n        return null;\n    }\n\n    /**\n     * Convert Uri into File, if possible.\n     *\n     * @return file A local file that the Uri was pointing to, or null\n     * if the Uri is unsupported or pointed to a remote\n     * resource.\n     * @author paulburke\n     * @see #getPath(Context, Uri)\n     */\n    public static File getFile(Context context, Uri uri)\n    {\n        if (uri != null)\n        {\n            String path = getPath(context, uri);\n            if (isLocal(path))\n            {\n                return new File(path);\n            }\n        }\n        return null;\n    }\n\n    /**\n     * Get the file size in a human-readable string.\n     *\n     * @param size\n     * @return\n     * @author paulburke\n     */\n    public static String getReadableFileSize(long size)\n    {\n        final int BYTES_IN_KILOBYTES = 1024;\n        final DecimalFormat dec = new DecimalFormat(\"###.#\");\n        final String KILOBYTES = \" KB\";\n        final String MEGABYTES = \" MB\";\n        final String GIGABYTES = \" GB\";\n        float fileSize = 0;\n        String suffix = KILOBYTES;\n\n        if (size > BYTES_IN_KILOBYTES)\n        {\n            fileSize = size / BYTES_IN_KILOBYTES;\n            if (fileSize > BYTES_IN_KILOBYTES)\n            {\n                fileSize = fileSize / BYTES_IN_KILOBYTES;\n                if (fileSize > BYTES_IN_KILOBYTES)\n                {\n                    fileSize = fileSize / BYTES_IN_KILOBYTES;\n                    suffix = GIGABYTES;\n                }\n                else\n                {\n                    suffix = MEGABYTES;\n                }\n            }\n        }\n        return String.valueOf(dec.format(fileSize) + suffix);\n    }\n\n    /**\n     * Attempt to retrieve the thumbnail of given File from the\n     * MediaStore. This should not be called on the UI thread.\n     *\n     * @param context\n     * @param file\n     * @return\n     * @author paulburke\n     */\n    public static Bitmap getThumbnail(Context context, File file)\n    {\n        return getThumbnail(context, getUri(file), getMimeType(file));\n    }\n\n    /**\n     * Attempt to retrieve the thumbnail of given Uri from the\n     * MediaStore. This should not be called on the UI thread.\n     *\n     * @param context\n     * @param uri\n     * @return\n     * @author paulburke\n     */\n    public static Bitmap getThumbnail(Context context, Uri uri)\n    {\n        return getThumbnail(context, uri, getMimeType(context, uri));\n    }\n\n    /**\n     * Attempt to retrieve the thumbnail of given Uri from the\n     * MediaStore. This should not be called on the UI thread.\n     *\n     * @param context\n     * @param uri\n     * @param mimeType\n     * @return\n     * @author paulburke\n     */\n    @SuppressWarnings(\"deprecation\")\n    public static Bitmap getThumbnail(Context context, Uri uri,\n                                      String mimeType)\n    {\n        if (BuildConfig.DEBUG)\n            Log.d(TAG, \"Attempting to get thumbnail\");\n\n        if (!isMediaUri(uri))\n        {\n            Log.e(TAG,\n                  \"You can only retrieve thumbnails for images and videos.\");\n            return null;\n        }\n\n        Bitmap bm = null;\n        final ContentResolver resolver = context.getContentResolver();\n        try (Cursor cursor = resolver.query(uri, null, null, null, null))\n        {\n            if (cursor.moveToFirst())\n            {\n                final int id = cursor.getInt(0);\n                if (BuildConfig.DEBUG)\n                    Log.d(TAG, \"Got thumb ID: \" + id);\n\n                if (mimeType.contains(\"video\"))\n                {\n                    bm = MediaStore.Video.Thumbnails.getThumbnail(\n                             resolver,\n                             id,\n                             MediaStore.Video.Thumbnails.MINI_KIND,\n                             null);\n                }\n                else if (mimeType.contains(FileUtils.MIME_TYPE_IMAGE))\n                {\n                    bm = MediaStore.Images.Thumbnails.getThumbnail(\n                             resolver,\n                             id,\n                             MediaStore.Images.Thumbnails.MINI_KIND,\n                             null);\n                }\n            }\n        }\n        catch (Exception e)\n        {\n            if (BuildConfig.DEBUG)\n                Log.e(TAG, \"getThumbnail\", e);\n        }\n        return bm;\n    }\n\n    /**\n     * Get the Intent for selecting content to be used in an Intent Chooser.\n     *\n     * @return The intent for opening a file with Intent.createChooser()\n     * @author paulburke\n     */\n    public static Intent createGetContentIntent()\n    {\n        // Implicitly allow the user to select a particular kind of data\n        final Intent intent = new Intent(Intent.ACTION_GET_CONTENT);\n        // The MIME data type filter\n        intent.setType(\"*/*\");\n        // Only return URIs that can be opened with ContentResolver\n        intent.addCategory(Intent.CATEGORY_OPENABLE);\n        return intent;\n    }\n}\n"
  },
  {
    "path": "src/main/java/org/billthefarmer/editor/NewFile.java",
    "content": "////////////////////////////////////////////////////////////////////////////////\n//\n//  Editor - Text editor for Android\n//\n//  Copyright © 2019  Bill Farmer\n//\n//  This program is free software: you can redistribute it and/or modify\n//  it under the terms of the GNU General Public License as published by\n//  the Free Software Foundation, either version 3 of the License, or\n//  (at your option) any later version.\n//\n//  This program is distributed in the hope that it will be useful,\n//  but WITHOUT ANY WARRANTY; without even the implied warranty of\n//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//  GNU General Public License for more details.\n//\n//  You should have received a copy of the GNU General Public License\n//  along with this program.  If not, see <http://www.gnu.org/licenses/>.\n//\n//  Bill Farmer\t william j farmer [at] yahoo [dot] co [dot] uk.\n//\n////////////////////////////////////////////////////////////////////////////////\n\npackage org.billthefarmer.editor;\n\nimport android.app.Activity;\nimport android.content.Intent;\nimport android.os.Bundle;\n\npublic class NewFile extends Activity\n{\n    public final static String TAG = \"NewFile\";\n\n    // onCreate\n    @Override\n    @SuppressWarnings(\"deprecation\")\n    protected void onCreate(Bundle savedInstanceState)\n    {\n        super.onCreate(savedInstanceState);\n\n        // Create the shortcut intent\n        Intent shortcut = new\n            Intent(this, Editor.class);\n        shortcut.setAction(Editor.OPEN_NEW);\n        shortcut.addCategory(Intent.CATEGORY_DEFAULT);\n\n        // Create the shortcut\n        Intent intent = new Intent();\n        intent.putExtra(Intent.EXTRA_SHORTCUT_INTENT, shortcut);\n        intent.putExtra(Intent.EXTRA_SHORTCUT_NAME,\n                        getString(R.string.newFile));\n        intent.putExtra(Intent.EXTRA_SHORTCUT_ICON_RESOURCE,\n                        Intent.ShortcutIconResource.fromContext\n                        (this, R.drawable.ic_launcher));\n\n        setResult(RESULT_OK, intent);\n        finish();\n    }\n}\n"
  },
  {
    "path": "src/main/java/org/billthefarmer/editor/OpenFile.java",
    "content": "////////////////////////////////////////////////////////////////////////////////\n//\n//  Editor - Text editor for Android\n//\n//  Copyright © 2019  Bill Farmer\n//\n//  This program is free software: you can redistribute it and/or modify\n//  it under the terms of the GNU General Public License as published by\n//  the Free Software Foundation, either version 3 of the License, or\n//  (at your option) any later version.\n//\n//  This program is distributed in the hope that it will be useful,\n//  but WITHOUT ANY WARRANTY; without even the implied warranty of\n//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//  GNU General Public License for more details.\n//\n//  You should have received a copy of the GNU General Public License\n//  along with this program.  If not, see <http://www.gnu.org/licenses/>.\n//\n//  Bill Farmer\t william j farmer [at] yahoo [dot] co [dot] uk.\n//\n////////////////////////////////////////////////////////////////////////////////\n\npackage org.billthefarmer.editor;\n\nimport android.Manifest;\nimport android.app.Activity;\nimport android.app.AlertDialog;\nimport android.content.Context;\nimport android.content.DialogInterface;\nimport android.content.Intent;\nimport android.content.SharedPreferences;\nimport android.content.pm.PackageManager;\nimport android.content.res.Configuration;\nimport android.net.Uri;\nimport android.os.Build;\nimport android.os.Bundle;\nimport android.os.Environment;\nimport android.preference.PreferenceManager;\nimport android.view.View;\nimport android.view.ViewGroup;\nimport android.widget.Button;\nimport android.widget.EditText;\nimport android.widget.HorizontalScrollView;\nimport android.widget.LinearLayout;\nimport android.widget.TextView;\n\nimport java.io.File;\n\nimport java.util.ArrayList;\nimport java.util.Arrays;\nimport java.util.List;\n\npublic class OpenFile extends Activity\n{\n    public final static String TAG = \"OpenFile\";\n\n    private TextView nameView;\n    private TextView pathView;\n\n    private String path;\n    private File file;\n    private Uri uri;\n\n    // onCreate\n    @Override\n    @SuppressWarnings(\"deprecation\")\n    protected void onCreate(Bundle savedInstanceState)\n    {\n        super.onCreate(savedInstanceState);\n\n        // Get preferences\n        SharedPreferences preferences =\n            PreferenceManager.getDefaultSharedPreferences(this);\n\n        int theme = preferences.getInt(Editor.PREF_THEME, Editor.LIGHT);\n\n        // Get day/night mode\n        Configuration config = getResources().getConfiguration();\n        int night = config.uiMode & Configuration.UI_MODE_NIGHT_MASK;\n\n        // Set theme\n        switch (theme)\n        {\n        case Editor.LIGHT:\n            setTheme(R.style.DialogTheme);\n            break;\n\n        case Editor.DARK:\n            setTheme(R.style.DialogDarkTheme);\n            break;\n\n        case Editor.SYSTEM:\n            switch (night)\n            {\n            case Configuration.UI_MODE_NIGHT_NO:\n                setTheme(R.style.DialogTheme);\n                break;\n\n            case Configuration.UI_MODE_NIGHT_YES:\n                setTheme(R.style.DialogDarkTheme);\n                break;\n            }\n            break;\n\n        case Editor.WHITE:\n            setTheme(R.style.DialogWhiteTheme);\n            break;\n\n        case Editor.BLACK:\n            setTheme(R.style.DialogBlackTheme);\n            break;\n\n        case Editor.RETRO:\n            setTheme(R.style.DialogRetroTheme);\n            break;\n        }\n\n        // Set content\n        setContentView(R.layout.open_file);\n\n        // Find views\n        nameView = findViewById(R.id.name);\n        pathView = findViewById(R.id.path);\n\n        // Get last path\n        boolean last = preferences.getBoolean(Editor.PREF_LAST, false);\n        String lastPath = preferences.getString(Editor.PREF_FILE, \"\");\n\n        // Configure buttons\n        Button cancel = findViewById(R.id.cancel);\n        cancel.setOnClickListener((v) ->\n        {\n            setResult(RESULT_CANCELED, null);\n            finish();\n        });\n\n        Button openFile = findViewById(R.id.openFile);\n        openFile.setOnClickListener((v) ->\n        {\n            if (last && !lastPath.isEmpty())\n                getFile(new File(lastPath).getParentFile());\n\n            else\n                getFile(new File(Environment.getExternalStorageDirectory(),\n                                 Editor.DOCUMENTS));\n        });\n\n        Button create = findViewById(R.id.create);\n        create.setOnClickListener((v) ->\n        {\n            if (pathView.length() == 0)\n                return;\n\n            // Create the shortcut intent\n            Intent shortcut = new Intent(this, Editor.class);\n            shortcut.setAction(Intent.ACTION_EDIT);\n            shortcut.addCategory(Intent.CATEGORY_DEFAULT);\n\n            if (uri == null)\n            {\n                file = new File(pathView.getText().toString());\n                if (!file.isAbsolute())\n                    file = new File(Environment.getExternalStorageDirectory(),\n                                    file.getPath());\n                uri = Uri.fromFile(file);\n\n                if (nameView.length() == 0)\n                    nameView.setText(uri.getLastPathSegment());\n\n            }\n\n            // Set uri\n            shortcut.setData(uri);\n\n            // Create the shortcut\n            Intent intent = new Intent();\n            intent.putExtra(Intent.EXTRA_SHORTCUT_INTENT, shortcut);\n            intent.putExtra(Intent.EXTRA_SHORTCUT_NAME,\n                            nameView.getText().toString());\n            intent.putExtra(Intent.EXTRA_SHORTCUT_ICON_RESOURCE,\n                            Intent.ShortcutIconResource.fromContext\n                            (this, R.drawable.ic_launcher));\n\n            setResult(RESULT_OK, intent);\n            finish();\n        });\n\n        // Check permissions\n        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M)\n        {\n            if (checkSelfPermission(Manifest.permission.READ_EXTERNAL_STORAGE)\n                != PackageManager.PERMISSION_GRANTED)\n            {\n                requestPermissions(new String[]\n                    {Manifest.permission.WRITE_EXTERNAL_STORAGE,\n                     Manifest.permission.READ_EXTERNAL_STORAGE},\n                                   Editor.REQUEST_OPEN);\n                return;\n            }\n        }\n\n        if (last && !lastPath.isEmpty())\n            getFile(new File(lastPath).getParentFile());\n\n        else\n            getFile(new File(Environment.getExternalStorageDirectory(),\n                             Editor.DOCUMENTS));\n    }\n\n    // onRequestPermissionsResult\n    @Override\n    public void onRequestPermissionsResult(int requestCode,\n                                           String[] permissions,\n                                           int[] grantResults)\n    {\n        switch (requestCode)\n        {\n        case Editor.REQUEST_OPEN:\n            for (int i = 0; i < grantResults.length; i++)\n                if (permissions[i].equals(Manifest.permission\n                                          .READ_EXTERNAL_STORAGE) &&\n                    grantResults[i] == PackageManager.PERMISSION_GRANTED)\n                    // Granted, get file\n                    getFile(new File(Environment.getExternalStorageDirectory(),\n                                     Editor.DOCUMENTS));\n            break;\n        }\n    }\n\n    // onActivityResult\n    @Override\n    protected void onActivityResult(int requestCode, int resultCode,\n                                    Intent data)\n    {\n        if (resultCode == RESULT_CANCELED)\n            return;\n\n        switch (requestCode)\n        {\n        case Editor.OPEN_DOCUMENT:\n            uri = data.getData();\n            path = uri.getPath();\n            pathView.setText(path);\n            nameView.setText(FileUtils.getDisplayName(this, uri,\n                                                      null, null));\n            break;\n        }\n    }\n\n    // getFile\n    private void getFile(File dir)\n    {\n        // Get list of files\n        List<File> fileList = Editor.getList(dir);\n        if (fileList == null)\n            return;\n\n        // Get list of folders\n        List<String> dirList = new ArrayList<String>();\n        dirList.add(File.separator);\n        dirList.addAll(Uri.fromFile(dir).getPathSegments());\n\n        // Pop up dialog\n        Editor.openDialog(this, dirList, fileList, (dialog, which) ->\n        {\n            if (DialogInterface.BUTTON_NEUTRAL == which)\n            {\n                // Use storage\n                Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);\n                intent.setType(Editor.TEXT_WILD);\n                intent.addCategory(Intent.CATEGORY_OPENABLE);\n                startActivityForResult(intent, Editor.OPEN_DOCUMENT);\n                return;\n            }\n\n            if (Editor.FOLDER_OFFSET <= which)\n            {\n                File file = new File(File.separator);\n                for (int i = 0; i <= which - Editor.FOLDER_OFFSET; i++)\n                    file = new File(file, dirList.get(i));\n                if (file.isDirectory())\n                    getFile(file);\n                return;\n            }\n\n            File selection = fileList.get(which);\n            if (selection.isDirectory())\n                getFile(selection);\n\n            else\n            {\n                uri = Uri.fromFile(selection);\n                path = uri.getPath();\n                pathView.setText(path);\n                nameView.setText(uri.getLastPathSegment());\n            }\n        });\n    }\n}\n"
  },
  {
    "path": "src/main/res/color/text_color_retro.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <item android:state_enabled=\"false\"\n        android:color=\"@color/colorRetroForegroundDisabled\"/>\n    <item android:color=\"@color/colorRetroForeground\"/>\n</selector>\n"
  },
  {
    "path": "src/main/res/drawable/ic_add_black_24dp.xml",
    "content": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n        android:width=\"24dp\"\n        android:height=\"24dp\"\n        android:viewportWidth=\"24.0\"\n        android:viewportHeight=\"24.0\">\n    <path\n        android:fillColor=\"#FF000000\"\n        android:pathData=\"M19,13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z\"/>\n</vector>\n"
  },
  {
    "path": "src/main/res/drawable/ic_add_white_24dp.xml",
    "content": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n        android:width=\"24dp\"\n        android:height=\"24dp\"\n        android:viewportWidth=\"24.0\"\n        android:viewportHeight=\"24.0\">\n    <path\n        android:fillColor=\"#FFFFFFFF\"\n        android:pathData=\"M19,13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z\"/>\n</vector>\n"
  },
  {
    "path": "src/main/res/drawable/ic_edit_black_24dp.xml",
    "content": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n        android:width=\"24dp\"\n        android:height=\"24dp\"\n        android:viewportWidth=\"24.0\"\n        android:viewportHeight=\"24.0\">\n    <path\n        android:fillColor=\"#FF000000\"\n        android:pathData=\"M3,17.25V21h3.75L17.81,9.94l-3.75,-3.75L3,17.25zM20.71,7.04c0.39,-0.39 0.39,-1.02 0,-1.41l-2.34,-2.34c-0.39,-0.39 -1.02,-0.39 -1.41,0l-1.83,1.83 3.75,3.75 1.83,-1.83z\"/>\n</vector>\n"
  },
  {
    "path": "src/main/res/drawable/ic_edit_white_24dp.xml",
    "content": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n        android:width=\"24dp\"\n        android:height=\"24dp\"\n        android:viewportWidth=\"24.0\"\n        android:viewportHeight=\"24.0\">\n    <path\n        android:fillColor=\"#FFFFFFFF\"\n        android:pathData=\"M3,17.25V21h3.75L17.81,9.94l-3.75,-3.75L3,17.25zM20.71,7.04c0.39,-0.39 0.39,-1.02 0,-1.41l-2.34,-2.34c-0.39,-0.39 -1.02,-0.39 -1.41,0l-1.83,1.83 3.75,3.75 1.83,-1.83z\"/>\n</vector>\n"
  },
  {
    "path": "src/main/res/drawable/ic_folder_open_black_24dp.xml",
    "content": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n        android:width=\"24dp\"\n        android:height=\"24dp\"\n        android:viewportWidth=\"24.0\"\n        android:viewportHeight=\"24.0\">\n    <path\n        android:fillColor=\"#FF000000\"\n        android:pathData=\"M20,6h-8l-2,-2L4,4c-1.1,0 -1.99,0.9 -1.99,2L2,18c0,1.1 0.9,2 2,2h16c1.1,0 2,-0.9 2,-2L22,8c0,-1.1 -0.9,-2 -2,-2zM20,18L4,18L4,8h16v10z\"/>\n</vector>\n"
  },
  {
    "path": "src/main/res/drawable/ic_folder_open_white_24dp.xml",
    "content": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n        android:width=\"24dp\"\n        android:height=\"24dp\"\n        android:viewportWidth=\"24.0\"\n        android:viewportHeight=\"24.0\">\n    <path\n        android:fillColor=\"#FFFFFFFF\"\n        android:pathData=\"M20,6h-8l-2,-2L4,4c-1.1,0 -1.99,0.9 -1.99,2L2,18c0,1.1 0.9,2 2,2h16c1.1,0 2,-0.9 2,-2L22,8c0,-1.1 -0.9,-2 -2,-2zM20,18L4,18L4,8h16v10z\"/>\n</vector>\n"
  },
  {
    "path": "src/main/res/drawable/ic_image_black_24dp.xml",
    "content": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n        android:width=\"24dp\"\n        android:height=\"24dp\"\n        android:viewportWidth=\"24.0\"\n        android:viewportHeight=\"24.0\">\n    <path\n        android:fillColor=\"#FF000000\"\n        android:pathData=\"M21,19V5c0,-1.1 -0.9,-2 -2,-2H5c-1.1,0 -2,0.9 -2,2v14c0,1.1 0.9,2 2,2h14c1.1,0 2,-0.9 2,-2zM8.5,13.5l2.5,3.01L14.5,12l4.5,6H5l3.5,-4.5z\"/>\n</vector>\n"
  },
  {
    "path": "src/main/res/drawable/ic_image_white_24dp.xml",
    "content": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n        android:width=\"24dp\"\n        android:height=\"24dp\"\n        android:viewportWidth=\"24.0\"\n        android:viewportHeight=\"24.0\">\n    <path\n        android:fillColor=\"#FFFFFFFF\"\n        android:pathData=\"M21,19V5c0,-1.1 -0.9,-2 -2,-2H5c-1.1,0 -2,0.9 -2,2v14c0,1.1 0.9,2 2,2h14c1.1,0 2,-0.9 2,-2zM8.5,13.5l2.5,3.01L14.5,12l4.5,6H5l3.5,-4.5z\"/>\n</vector>\n"
  },
  {
    "path": "src/main/res/drawable/ic_list_black_24dp.xml",
    "content": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n        android:width=\"24dp\"\n        android:height=\"24dp\"\n        android:viewportWidth=\"24.0\"\n        android:viewportHeight=\"24.0\">\n    <path\n        android:fillColor=\"#FF000000\"\n        android:pathData=\"M4,2h16v2h-16zM4,20h16v2h-16zM4,4v16h2v-16zM18,4v16h2v-16zM6,5h12v2h-12zM6,8h12v2h-12zM6,11h12v2h-12zM6,14h12v2h-12zM6,17h12v2h-12z\" />\n</vector>\n"
  },
  {
    "path": "src/main/res/drawable/ic_list_white_24dp.xml",
    "content": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n        android:width=\"24dp\"\n        android:height=\"24dp\"\n        android:viewportWidth=\"24.0\"\n        android:viewportHeight=\"24.0\">\n    <path\n        android:fillColor=\"#FFFFFFFF\"\n        android:pathData=\"M4,2h16v2h-16zM4,20h16v2h-16zM4,4v16h2v-16zM18,4v16h2v-16zM6,5h12v2h-12zM6,8h12v2h-12zM6,11h12v2h-12zM6,14h12v2h-12zM6,17h12v2h-12z\" />\n</vector>\n"
  },
  {
    "path": "src/main/res/drawable/ic_reply_black_24dp.xml",
    "content": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n        android:width=\"24dp\"\n        android:height=\"24dp\"\n        android:viewportWidth=\"24.0\"\n        android:viewportHeight=\"24.0\">\n    <path\n        android:fillColor=\"#FF000000\"\n        android:pathData=\"M10,9V5l-7,7 7,7v-4.1c5,0 8.5,1.6 11,5.1 -1,-5 -4,-10 -11,-11z\"/>\n</vector>\n"
  },
  {
    "path": "src/main/res/drawable/ic_reply_white_24dp.xml",
    "content": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n        android:width=\"24dp\"\n        android:height=\"24dp\"\n        android:viewportWidth=\"24.0\"\n        android:viewportHeight=\"24.0\">\n    <path\n        android:fillColor=\"#FFFFFFFF\"\n        android:pathData=\"M10,9V5l-7,7 7,7v-4.1c5,0 8.5,1.6 11,5.1 -1,-5 -4,-10 -11,-11z\"/>\n</vector>\n"
  },
  {
    "path": "src/main/res/drawable/ic_save_black_24dp.xml",
    "content": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n        android:width=\"24dp\"\n        android:height=\"24dp\"\n        android:viewportWidth=\"24.0\"\n        android:viewportHeight=\"24.0\">\n    <path\n        android:fillColor=\"#FF000000\"\n        android:pathData=\"M17,3L5,3c-1.11,0 -2,0.9 -2,2v14c0,1.1 0.89,2 2,2h14c1.1,0 2,-0.9 2,-2L21,7l-4,-4zM12,19c-1.66,0 -3,-1.34 -3,-3s1.34,-3 3,-3 3,1.34 3,3 -1.34,3 -3,3zM15,9L5,9L5,5h10v4z\"/>\n</vector>\n"
  },
  {
    "path": "src/main/res/drawable/ic_save_white_24dp.xml",
    "content": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n        android:width=\"24dp\"\n        android:height=\"24dp\"\n        android:viewportWidth=\"24.0\"\n        android:viewportHeight=\"24.0\">\n    <path\n        android:fillColor=\"#FFFFFFFF\"\n        android:pathData=\"M17,3L5,3c-1.11,0 -2,0.9 -2,2v14c0,1.1 0.89,2 2,2h14c1.1,0 2,-0.9 2,-2L21,7l-4,-4zM12,19c-1.66,0 -3,-1.34 -3,-3s1.34,-3 3,-3 3,1.34 3,3 -1.34,3 -3,3zM15,9L5,9L5,5h10v4z\"/>\n</vector>\n"
  },
  {
    "path": "src/main/res/drawable/ic_sd_storage_black_24dp.xml",
    "content": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n        android:width=\"24dp\"\n        android:height=\"24dp\"\n        android:viewportWidth=\"24.0\"\n        android:viewportHeight=\"24.0\">\n    <path\n        android:fillColor=\"#FF000000\"\n        android:pathData=\"M18,2h-8L4.02,8 4,20c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2L20,4c0,-1.1 -0.9,-2 -2,-2zM12,8h-2L10,4h2v4zM15,8h-2L13,4h2v4zM18,8h-2L16,4h2v4z\"/>\n</vector>\n"
  },
  {
    "path": "src/main/res/drawable/ic_sd_storage_white_24dp.xml",
    "content": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n        android:width=\"24dp\"\n        android:height=\"24dp\"\n        android:viewportWidth=\"24.0\"\n        android:viewportHeight=\"24.0\">\n    <path\n        android:fillColor=\"#FFFFFFFF\"\n        android:pathData=\"M18,2h-8L4.02,8 4,20c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2L20,4c0,-1.1 -0.9,-2 -2,-2zM12,8h-2L10,4h2v4zM15,8h-2L13,4h2v4zM18,8h-2L16,4h2v4z\"/>\n</vector>\n"
  },
  {
    "path": "src/main/res/drawable/ic_stop_black_24dp.xml",
    "content": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n        android:width=\"24dp\"\n        android:height=\"24dp\"\n        android:viewportWidth=\"24.0\"\n        android:viewportHeight=\"24.0\">\n    <path\n        android:fillColor=\"#FF000000\"\n        android:pathData=\"M6,6h12v12H6z\"/>\n</vector>\n"
  },
  {
    "path": "src/main/res/drawable/ic_stop_white_24dp.xml",
    "content": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n        android:width=\"24dp\"\n        android:height=\"24dp\"\n        android:viewportWidth=\"24.0\"\n        android:viewportHeight=\"24.0\">\n    <path\n        android:fillColor=\"#FFFFFFFF\"\n        android:pathData=\"M6,6h12v12H6z\"/>\n</vector>\n"
  },
  {
    "path": "src/main/res/drawable/ic_videocam_black_24dp.xml",
    "content": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n        android:width=\"24dp\"\n        android:height=\"24dp\"\n        android:viewportWidth=\"24.0\"\n        android:viewportHeight=\"24.0\">\n    <path\n        android:fillColor=\"#FF000000\"\n        android:pathData=\"M17,10.5V7c0,-0.55 -0.45,-1 -1,-1H4c-0.55,0 -1,0.45 -1,1v10c0,0.55 0.45,1 1,1h12c0.55,0 1,-0.45 1,-1v-3.5l4,4v-11l-4,4z\"/>\n</vector>\n"
  },
  {
    "path": "src/main/res/drawable/ic_videocam_white_24dp.xml",
    "content": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n        android:width=\"24dp\"\n        android:height=\"24dp\"\n        android:viewportWidth=\"24.0\"\n        android:viewportHeight=\"24.0\">\n    <path\n        android:fillColor=\"#FFFFFFFF\"\n        android:pathData=\"M17,10.5V7c0,-0.55 -0.45,-1 -1,-1H4c-0.55,0 -1,0.45 -1,1v10c0,0.55 0.45,1 1,1h12c0.55,0 1,-0.45 1,-1v-3.5l4,4v-11l-4,4z\"/>\n</vector>\n"
  },
  {
    "path": "src/main/res/drawable/ic_volume_up_black_24dp.xml",
    "content": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n        android:width=\"24dp\"\n        android:height=\"24dp\"\n        android:viewportWidth=\"24.0\"\n        android:viewportHeight=\"24.0\">\n    <path\n        android:fillColor=\"#FF000000\"\n        android:pathData=\"M3,9v6h4l5,5L12,4L7,9L3,9zM16.5,12c0,-1.77 -1.02,-3.29 -2.5,-4.03v8.05c1.48,-0.73 2.5,-2.25 2.5,-4.02zM14,3.23v2.06c2.89,0.86 5,3.54 5,6.71s-2.11,5.85 -5,6.71v2.06c4.01,-0.91 7,-4.49 7,-8.77s-2.99,-7.86 -7,-8.77z\"/>\n</vector>\n"
  },
  {
    "path": "src/main/res/drawable/ic_volume_up_white_24dp.xml",
    "content": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n        android:width=\"24dp\"\n        android:height=\"24dp\"\n        android:viewportWidth=\"24.0\"\n        android:viewportHeight=\"24.0\">\n    <path\n        android:fillColor=\"#FFFFFFFF\"\n        android:pathData=\"M3,9v6h4l5,5L12,4L7,9L3,9zM16.5,12c0,-1.77 -1.02,-3.29 -2.5,-4.03v8.05c1.48,-0.73 2.5,-2.25 2.5,-4.02zM14,3.23v2.06c2.89,0.86 5,3.54 5,6.71s-2.11,5.85 -5,6.71v2.06c4.01,-0.91 7,-4.49 7,-8.77s-2.99,-7.86 -7,-8.77z\"/>\n</vector>\n"
  },
  {
    "path": "src/main/res/layout/custom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<TextView\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:id=\"@+id/count\"\n    android:layout_width=\"wrap_content\"\n    android:layout_height=\"wrap_content\"\n    android:layout_gravity=\"right\"\n    android:paddingLeft=\"16dp\"\n    android:paddingRight=\"16dp\"\n    android:textAppearance=\"?android:attr/textAppearanceSmall\"\n    tools:ignore=\"RtlHardcoded\" />\n\n"
  },
  {
    "path": "src/main/res/layout/edit.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<ScrollView\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:id=\"@+id/vscroll\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:layout_marginLeft=\"8dp\"\n    android:layout_marginRight=\"8dp\"\n    android:layout_marginBottom=\"8dp\"\n    android:fillViewport=\"true\">\n\n  <HorizontalScrollView\n      android:id=\"@+id/hscroll\"\n      android:layout_width=\"match_parent\"\n      android:layout_height=\"wrap_content\"\n      android:fillViewport=\"true\"\n      tools:ignore=\"LabelFor\">\n\n    <EditText\n        android:id=\"@+id/text\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"match_parent\"\n        android:gravity=\"top\"\n        android:inputType=\"text|textMultiLine\"\n        android:typeface=\"monospace\"\n        tools:ignore=\"Autofill\" />\n\n  </HorizontalScrollView>\n\n</ScrollView>\n"
  },
  {
    "path": "src/main/res/layout/file.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<TextView\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:id=\"@+id/name\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"wrap_content\"\n    android:drawablePadding=\"8dp\"\n    android:paddingLeft=\"16dp\"\n    android:paddingRight=\"16dp\"\n    android:textAppearance=\"?android:attr/textAppearanceMedium\"\n    tools:ignore=\"RtlHardcoded\" />\n"
  },
  {
    "path": "src/main/res/layout/open_file.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:layout_marginLeft=\"8dp\"\n    android:layout_marginRight=\"8dp\"\n    android:layout_marginBottom=\"8dp\"\n    android:orientation=\"vertical\"\n    tools:ignore=\"Autofill\">\n\n  <EditText\n      android:id=\"@+id/name\"\n      android:layout_width=\"fill_parent\"\n      android:layout_height=\"wrap_content\"\n      android:layout_marginLeft=\"8dp\"\n      android:layout_marginRight=\"8dp\"\n      android:hint=\"@string/name\"\n      android:inputType=\"text\" />\n\n  <EditText\n      android:id=\"@+id/path\"\n      android:layout_width=\"fill_parent\"\n      android:layout_height=\"wrap_content\"\n      android:layout_marginLeft=\"8dp\"\n      android:layout_marginRight=\"8dp\"\n      android:hint=\"@string/path\"\n      android:inputType=\"text\" />\n\n  <LinearLayout\n      android:layout_width=\"wrap_content\"\n      android:layout_height=\"wrap_content\"\n      android:layout_gravity=\"center_horizontal\"\n      android:layout_marginTop=\"8dp\"\n      android:layout_marginBottom=\"8dp\"\n      android:orientation=\"horizontal\"\n      style=\"?android:attr/buttonBarStyle\">\n\n    <Button\n        android:id=\"@+id/cancel\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:text=\"@string/cancel\"\n        style=\"?android:attr/buttonBarButtonStyle\" />\n\n    <Button\n        android:id=\"@+id/openFile\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:text=\"@string/openFile\"\n        style=\"?android:attr/buttonBarButtonStyle\" />\n\n    <Button\n        android:id=\"@+id/create\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:text=\"@string/create\"\n        style=\"?android:attr/buttonBarButtonStyle\" />\n\n  </LinearLayout>\n\n</LinearLayout>\n"
  },
  {
    "path": "src/main/res/layout/save_path.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"wrap_content\"\n    android:orientation=\"vertical\"\n    tools:ignore=\"RtlHardcoded\">\n\n  <EditText\n      android:id=\"@+id/pathText\"\n      android:layout_width=\"match_parent\"\n      android:layout_height=\"wrap_content\"\n      android:layout_marginLeft=\"24dp\"\n      android:layout_marginRight=\"24dp\"\n      android:layout_marginBottom=\"8dp\"\n      android:hint=\"@string/saveAs\"\n      android:inputType=\"text|textMultiLine\"\n      android:textAppearance=\"?android:attr/textAppearanceMedium\"\n      tools:ignore=\"Autofill\" />\n\n</LinearLayout>\n"
  },
  {
    "path": "src/main/res/layout/seek_bar.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"wrap_content\"\n    android:orientation=\"vertical\"\n    tools:ignore=\"RtlHardcoded\">\n\n  <SeekBar\n      android:id=\"@+id/seekBar\"\n      android:layout_width=\"match_parent\"\n      android:layout_height=\"wrap_content\"\n      android:layout_marginLeft=\"16dp\"\n      android:layout_marginRight=\"16dp\"\n      android:layout_marginTop=\"16dp\"\n      android:max=\"1000\" />\n\n</LinearLayout>\n"
  },
  {
    "path": "src/main/res/layout/wrap.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<ScrollView\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:id=\"@+id/vscroll\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:layout_marginLeft=\"8dp\"\n    android:layout_marginRight=\"8dp\"\n    android:layout_marginBottom=\"8dp\"\n    android:fillViewport=\"true\"\n    tools:ignore=\"LabelFor\">\n\n  <EditText\n      android:id=\"@+id/text\"\n      android:layout_width=\"match_parent\"\n      android:layout_height=\"wrap_content\"\n      android:gravity=\"top\"\n      android:inputType=\"text|textMultiLine\"\n      android:typeface=\"monospace\"\n      tools:ignore=\"Autofill\" />\n\n</ScrollView>\n"
  },
  {
    "path": "src/main/res/menu/main.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<menu\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    tools:ignore=\"AppCompatResource\">\n  <item\n      android:id=\"@+id/findAll\"\n      android:showAsAction=\"never\"\n      android:title=\"@string/findAll\" />\n  <item\n      android:id=\"@+id/edit\"\n      android:icon=\"?attr/edit\"\n      android:showAsAction=\"ifRoom\"\n      android:title=\"@string/edit\" />\n  <item\n      android:id=\"@+id/view\"\n      android:icon=\"?attr/view\"\n      android:showAsAction=\"ifRoom\"\n      android:title=\"@string/view\" />\n  <item\n      android:id=\"@+id/save\"\n      android:icon=\"?attr/save\"\n      android:showAsAction=\"ifRoom\"\n      android:title=\"@string/save\" />\n  <item\n      android:id=\"@+id/newFile\"\n      android:icon=\"?attr/newFile\"\n      android:showAsAction=\"ifRoom\"\n      android:title=\"@string/newFile\" />\n  <item\n      android:id=\"@+id/open\"\n      android:icon=\"?attr/open\"\n      android:showAsAction=\"ifRoom\"\n      android:title=\"@string/open\" />\n  <item\n      android:id=\"@+id/openRecent\"\n      android:showAsAction=\"never\"\n      android:title=\"@string/openRecent\">\n    <menu>\n      <item\n          android:id=\"@+id/fileItem\"\n          android:showAsAction=\"never\"\n          android:title=\"\" />\n      <item\n          android:id=\"@+id/clearList\"\n          android:showAsAction=\"never\"\n          android:title=\"@string/clearList\" />\n    </menu>\n  </item>\n  <item\n      android:id=\"@+id/search\"\n      android:actionViewClass=\"android.widget.SearchView\"\n      android:showAsAction=\"never|collapseActionView\"\n      android:title=\"@string/search\" />\n  <item\n      android:id=\"@+id/saveAs\"\n      android:showAsAction=\"never\"\n      android:title=\"@string/saveAs\" />\n  <item\n      android:id=\"@+id/goTo\"\n      android:showAsAction=\"never\"\n      android:title=\"@string/goTo\" />\n  <item\n      android:id=\"@+id/print\"\n      android:showAsAction=\"never\"\n      android:title=\"@string/print\" />\n  <item\n      android:id=\"@+id/viewMarkdown\"\n      android:showAsAction=\"never\"\n      android:title=\"@string/viewMarkdown\" />\n  <item\n      android:id=\"@+id/charset\"\n      android:showAsAction=\"never\"\n      android:title=\"\">\n    <menu>\n      <item\n          android:id=\"@+id/charsetItem\"\n          android:showAsAction=\"never\"\n          android:title=\"\" />\n    </menu>\n  </item>\n  <item\n      android:id=\"@+id/options\"\n      android:showAsAction=\"never\"\n      android:title=\"@string/options\">\n    <menu>\n      <item\n          android:id=\"@+id/viewFile\"\n          android:checkable=\"true\"\n          android:checked=\"true\"\n          android:showAsAction=\"never\"\n          android:title=\"@string/viewFile\" />\n      <item\n          android:id=\"@+id/openLast\"\n          android:checkable=\"true\"\n          android:showAsAction=\"never\"\n          android:title=\"@string/openLast\" />\n      <item\n          android:id=\"@+id/autoSave\"\n          android:checkable=\"true\"\n          android:showAsAction=\"never\"\n          android:title=\"@string/autoSave\" />\n      <item\n          android:id=\"@+id/wrap\"\n          android:checkable=\"true\"\n          android:showAsAction=\"never\"\n          android:title=\"@string/wrap\" />\n      <item\n          android:id=\"@+id/suggest\"\n          android:checkable=\"true\"\n          android:checked=\"true\"\n          android:showAsAction=\"never\"\n          android:title=\"@string/suggest\" />\n      <item\n          android:id=\"@+id/highlight\"\n          android:checkable=\"true\"\n          android:checked=\"false\"\n          android:showAsAction=\"never\"\n          android:title=\"@string/highlight\" />\n    </menu>\n  </item>\n  <item\n      android:id=\"@+id/theme\"\n      android:showAsAction=\"never\"\n      android:title=\"@string/theme\">\n    <menu>\n      <group android:checkableBehavior=\"single\">\n        <item\n            android:id=\"@+id/light\"\n            android:showAsAction=\"never\"\n            android:title=\"@string/light\" />\n        <item\n            android:id=\"@+id/dark\"\n            android:showAsAction=\"never\"\n            android:title=\"@string/dark\" />\n        <item\n            android:id=\"@+id/system\"\n            android:showAsAction=\"never\"\n            android:title=\"@string/system\" />\n        <item\n            android:id=\"@+id/white\"\n            android:showAsAction=\"never\"\n            android:title=\"@string/white\" />\n        <item\n            android:id=\"@+id/black\"\n            android:showAsAction=\"never\"\n            android:title=\"@string/black\" />\n        <item\n            android:id=\"@+id/retro\"\n            android:showAsAction=\"never\"\n            android:title=\"@string/retro\" />\n      </group>\n    </menu>\n  </item>\n  <item\n      android:id=\"@+id/size\"\n      android:showAsAction=\"never\"\n      android:title=\"@string/size\">\n    <menu>\n      <group android:checkableBehavior=\"single\">\n        <item\n            android:id=\"@+id/small\"\n            android:showAsAction=\"never\"\n            android:title=\"@string/small\" />\n        <item\n            android:id=\"@+id/medium\"\n            android:showAsAction=\"never\"\n            android:title=\"@string/medium\" />\n        <item\n            android:id=\"@+id/large\"\n            android:showAsAction=\"never\"\n            android:title=\"@string/large\" />\n      </group>\n    </menu>\n  </item>\n  <item\n      android:id=\"@+id/typeface\"\n      android:showAsAction=\"never\"\n      android:title=\"@string/typeface\">\n    <menu>\n      <group android:checkableBehavior=\"single\">\n        <item\n            android:id=\"@+id/typefaceItem\"\n            android:showAsAction=\"never\"\n            android:title=\"\" />\n      </group>\n    </menu>\n  </item>\n  <item\n      android:id=\"@+id/about\"\n      android:showAsAction=\"never\"\n      android:title=\"@string/about\" />\n</menu>\n"
  },
  {
    "path": "src/main/res/values/arrays.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n\n  <string-array name=\"typefaces\">\n    <item>arial</item>\n    <item>baskerville</item>\n    <item>casual</item>\n    <item>courier new</item>\n    <item>courier</item>\n    <item>cursive</item>\n    <item>fantasy</item>\n    <item>georgia</item>\n    <item>goudy</item>\n    <item>helvetica</item>\n    <item>monaco</item>\n    <item>monospace</item>\n    <item>palatino</item>\n    <item>sans-serif-black</item>\n    <item>sans-serif-condensed-light</item>\n    <item>sans-serif-condensed-medium</item>\n    <item>sans-serif-condensed</item>\n    <item>sans-serif-light</item>\n    <item>sans-serif-medium</item>\n    <item>sans-serif-monospace</item>\n    <item>sans-serif-smallcaps</item>\n    <item>sans-serif-thin</item>\n    <item>sans-serif</item>\n    <item>serif-monospace</item>\n    <item>serif</item>\n    <item>source-sans-pro-semi-bold</item>\n    <item>source-sans-pro</item>\n    <item>tahoma</item>\n    <item>times new roman</item>\n    <item>times</item>\n    <item>verdana</item>\n  </string-array>\n\n</resources>\n"
  },
  {
    "path": "src/main/res/values/attrs.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n\n  <declare-styleable name=\"Editor\">\n\n    <attr name=\"application\" format=\"reference\" />\n    <attr name=\"external\" format=\"reference\" />\n    <attr name=\"folder\" format=\"reference\" />\n    <attr name=\"parent\" format=\"reference\" />\n    <attr name=\"audio\" format=\"reference\" />\n    <attr name=\"image\" format=\"reference\" />\n    <attr name=\"video\" format=\"reference\" />\n    <attr name=\"file\" format=\"reference\" />\n\n    <attr name=\"edit\" format=\"reference\" />\n    <attr name=\"open\" format=\"reference\" />\n    <attr name=\"save\" format=\"reference\" />\n    <attr name=\"view\" format=\"reference\" />\n    <attr name=\"newFile\" format=\"reference\" />\n\n  </declare-styleable>\n\n</resources>\n"
  },
  {
    "path": "src/main/res/values/colours.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n\n  <color name=\"colorRetroForeground\">#ff00ff00</color>\n  <color name=\"colorRetroForegroundDisabled\">#4c00ff00</color>\n\n</resources>\n"
  },
  {
    "path": "src/main/res/values/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    tools:ignore=\"MissingTranslation\">\n\n  <string name=\"appName\">Editor</string>\n\n  <string name=\"newFile\">New file</string>\n  <string name=\"openFile\">Open file</string>\n  <string name=\"name\">Name</string>\n  <string name=\"path\">Path</string>\n  <string name=\"create\">Create</string>\n  <string name=\"edit\">Edit</string>\n  <string name=\"view\">View</string>\n  <string name=\"open\">Open file…</string>\n  <string name=\"save\">Save</string>\n  <string name=\"storage\">Storage</string>\n  <string name=\"openRecent\">Open recent</string>\n  <string name=\"clearList\">Clear list</string>\n  <string name=\"search\">Search…</string>\n  <string name=\"findAll\">Find all…</string>\n  <string name=\"saveAs\">Save as…</string>\n  <string name=\"detect\">Detect</string>\n  <string name=\"goTo\">Go to…</string>\n  <string name=\"print\">Print…</string>\n  <string name=\"viewMarkdown\">View markdown…</string>\n  <string name=\"options\">Options</string>\n  <string name=\"viewFile\">View files</string>\n  <string name=\"openLast\">Open last</string>\n  <string name=\"autoSave\">Auto save</string>\n  <string name=\"wrap\">Word wrap</string>\n  <string name=\"suggest\">Suggestions</string>\n  <string name=\"highlight\">Highlight syntax</string>\n  <string name=\"theme\">Theme</string>\n  <string name=\"light\">Light</string>\n  <string name=\"dark\">Dark</string>\n  <string name=\"system\">System</string>\n  <string name=\"white\">White</string>\n  <string name=\"black\">Black</string>\n  <string name=\"retro\">Retro</string>\n  <string name=\"size\">Text size</string>\n  <string name=\"small\">Small</string>\n  <string name=\"medium\">Medium</string>\n  <string name=\"large\">Large</string>\n  <string name=\"typeface\">Typeface</string>\n  <string name=\"mono\">Monospace</string>\n  <string name=\"normal\">Proportional</string>\n  <string name=\"sans\">Sans serif</string>\n  <string name=\"serif\">Serif</string>\n  <string name=\"about\">About</string>\n\n  <!--\n      Note for translators: You don't need to translate all these\n      translation credits below. Just the version, copyright, credit\n      for your translation and the licence. Also add your translation\n      credit here.\n  -->\n  <string name=\"version\" formatted=\"false\"><a href=\"https://github.com/billthefarmer/editor/releases/latest\">%s</a>\\n\\nBuilt %s\\n\\nCopyright \\u00A9 2017 <a href=\"https://github.com/billthefarmer\">Bill Farmer</a>\\n\\nArabic translation by <a href=\"https://github.com/MuhammedSaleem-Brej\">MuhammedSaleem brej</a>,French translation by <a href=\"https://github.com/milouse\">Étienne Deparis</a>, German translation by <a href=\"https://github.com/Markus00000\">Markus Weimar</a> and <a href=\"https://github.com/AlexanderRitter02\">Alexander Ritter</a>, Italian translation by <a href=\"https://github.com/airon90\">Michael Moroni</a>, Polish translation by <a href=\"https://github.com/evo16\">Evo</a>, Greek translation by <a href=\"https://github.com/nikoss\">nikoss</a>, Spanish translation by <a href=\"https://github.com/foxneo\">Miguel Caceres</a>, Simplified Chinese translation by <a href=\"https://github.com/ludoux\">Lu Chang (ludoux)</a>, Dutch translation by <a href=\"https://github.com/Vistaus\">Heimen Stoffels (vistaus)</a>, Russian translation by <a href=\"https://github.com/bboa\">Igor Nedoboy</a>, Latvian translation by <a href=\"https://github.com/rhssk\">Rihards Skuja</a>, Icelandic translation by <a href=\"\">Sveinn í Felli</a>, Portuguese translation by <a href=\"https://github.com/Andre-Gloria\" >André Glória</a>, Chinese (Taiwan) translation by <a href=\"https://github.com/cges30901\">cges30901</a>, Turkish translation by <a href=\"https://github.com/yasarciv67\">Yaşar Çiv</a>, Brazilian Portuguese translation by <a href=\"https://github.com/aevw\">aevw</a>, Sorani Kurdish translation by <a href=\"https://github.com/rawandsaeed\">Rawand Saeed</a>, Persian (Farsi) translation by <a href=\"https://github.com/eshagh79\">Eshagh</a>, Hungarian translation by <a href=\"https://github.com/urbalazs\">Balázs Úr</a>, Japanese translation by <a href=\"https://gitlab.com/dokutoku\">dokutoku</a>, Belarusian translation by <a href=\"https://github.com/Atrafon\">Makar Razin</a>, Basque (eu) translation by <a href=\"https://github.com/alexgabi\">alexgabi</a>\\n\\nLicence <a href=\"https://www.gnu.org/licenses/gpl.txt\">GNU GPLv3</a>\n  </string>\n\n  <string name=\"tooLarge\">Too large %s</string>\n  <string name=\"choose\">Choose a file name</string>\n  <string name=\"loading\">Loading…</string>\n\n  <string name=\"modified\">\n    You have unsaved changes. Do you want to save your changes?\n  </string>\n\n  <string name=\"changedReload\">\n    This file has changed, do you want to reload it?\n  </string>\n\n  <string name=\"changedOverwrite\">\n    This file has changed, do you want to overwrite it?\n  </string>\n\n  <string name=\"manageFiles\"><p>In order to have access to the <b>Documents</b> and other folders <b>Editor</b> must use the <b>Files</b> or <b>All files access</b> permission depending upon the version of Android. If this is not allowed the app may still be able to access files using the <b>Storage</b> button in the file chooser.</p></string>\n  <string name=\"files\">Files</string>\n  <string name=\"access\">Access all files</string>\n\n  <string name=\"ok\">OK</string>\n  <string name=\"reload\">Reload</string>\n  <string name=\"overwrite\">Overwrite</string>\n  <string name=\"discard\">Discard</string>\n  <string name=\"cancel\">Cancel</string>\n\n</resources>\n"
  },
  {
    "path": "src/main/res/values/styles.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    tools:ignore=\"NewApi\">\n\n  <!--\n      Base application theme, dependent on API level. This theme is\n      replaced by AppBaseTheme from res/values-vXX/styles.xml on newer\n      devices.\n  -->\n  <style name=\"AppBaseTheme\" parent=\"android:Theme.Material.Light.DarkActionBar\">\n    <!--\n        Theme customizations available in newer API levels can go in\n        res/values-vXX/styles.xml, while customizations related to\n        backward-compatibility can go here.\n    -->\n\n    <item name=\"android:windowOptOutEdgeToEdgeEnforcement\">true</item>\n\n  </style>\n\n  <style name=\"AppDarkBaseTheme\" parent=\"android:Theme.Material\">\n    <!--\n        Theme customizations available in newer API levels can go in\n        res/values-vXX/styles.xml, while customizations related to\n        backward-compatibility can go here.\n    -->\n\n    <item name=\"android:windowOptOutEdgeToEdgeEnforcement\">true</item>\n\n  </style>\n\n  <style name=\"AppLightBaseTheme\" parent=\"android:Theme.Material.Light\">\n    <!--\n        Theme customizations available in newer API levels can go in\n        res/values-vXX/styles.xml, while customizations related to\n        backward-compatibility can go here.\n    -->\n\n    <item name=\"android:windowOptOutEdgeToEdgeEnforcement\">true</item>\n\n  </style>\n\n  <!-- Application theme. -->\n  <style name=\"AppTheme\" parent=\"AppBaseTheme\">\n    <!--\n        All customizations that are NOT specific to a particular\n        API-level can go here.\n    -->\n\n    <item name=\"application\">@drawable/ic_stop_black_24dp</item>\n    <item name=\"external\">@drawable/ic_sd_storage_black_24dp</item>\n    <item name=\"file\">@drawable/ic_list_black_24dp</item>\n    <item name=\"folder\">@drawable/ic_folder_open_black_24dp</item>\n    <item name=\"audio\">@drawable/ic_volume_up_black_24dp</item>\n    <item name=\"image\">@drawable/ic_image_black_24dp</item>\n    <item name=\"parent\">@drawable/ic_reply_black_24dp</item>\n    <item name=\"video\">@drawable/ic_videocam_black_24dp</item>\n\n    <item name=\"edit\">@drawable/ic_edit_white_24dp</item>\n    <item name=\"open\">@drawable/ic_folder_open_white_24dp</item>\n    <item name=\"save\">@drawable/ic_save_white_24dp</item>\n    <item name=\"view\">@drawable/ic_list_white_24dp</item>\n    <item name=\"newFile\">@drawable/ic_add_white_24dp</item>\n\n  </style>\n\n  <!-- Application theme. -->\n  <style name=\"AppWhiteTheme\" parent=\"AppLightBaseTheme\">\n    <!--\n        All customizations that are NOT specific to a particular\n        API-level can go here.\n    -->\n\n    <item name=\"application\">@drawable/ic_stop_black_24dp</item>\n    <item name=\"external\">@drawable/ic_sd_storage_black_24dp</item>\n    <item name=\"file\">@drawable/ic_list_black_24dp</item>\n    <item name=\"folder\">@drawable/ic_folder_open_black_24dp</item>\n    <item name=\"audio\">@drawable/ic_volume_up_black_24dp</item>\n    <item name=\"image\">@drawable/ic_image_black_24dp</item>\n    <item name=\"parent\">@drawable/ic_reply_black_24dp</item>\n    <item name=\"video\">@drawable/ic_videocam_black_24dp</item>\n\n    <item name=\"edit\">@drawable/ic_edit_black_24dp</item>\n    <item name=\"open\">@drawable/ic_folder_open_black_24dp</item>\n    <item name=\"save\">@drawable/ic_save_black_24dp</item>\n    <item name=\"view\">@drawable/ic_list_black_24dp</item>\n    <item name=\"newFile\">@drawable/ic_add_black_24dp</item>\n\n    <item name=\"android:textColorPrimary\">@android:color/black</item>\n    <item name=\"android:textColorSecondary\">@android:color/black</item>\n    <item name=\"android:textColorTertiary\">@android:color/black</item>\n\n  </style>\n\n  <!-- Application theme. -->\n  <style name=\"AppDarkTheme\" parent=\"AppDarkBaseTheme\">\n    <!--\n        All customizations that are NOT specific to a particular\n        API-level can go here.\n    -->\n\n    <item name=\"application\">@drawable/ic_stop_white_24dp</item>\n    <item name=\"external\">@drawable/ic_sd_storage_white_24dp</item>\n    <item name=\"file\">@drawable/ic_list_white_24dp</item>\n    <item name=\"folder\">@drawable/ic_folder_open_white_24dp</item>\n    <item name=\"audio\">@drawable/ic_volume_up_white_24dp</item>\n    <item name=\"image\">@drawable/ic_image_white_24dp</item>\n    <item name=\"parent\">@drawable/ic_reply_white_24dp</item>\n    <item name=\"video\">@drawable/ic_videocam_white_24dp</item>\n\n    <item name=\"edit\">@drawable/ic_edit_white_24dp</item>\n    <item name=\"open\">@drawable/ic_folder_open_white_24dp</item>\n    <item name=\"save\">@drawable/ic_save_white_24dp</item>\n    <item name=\"view\">@drawable/ic_list_white_24dp</item>\n    <item name=\"newFile\">@drawable/ic_add_white_24dp</item>\n\n  </style>\n\n  <!-- Application theme. -->\n  <style name=\"AppBlackTheme\" parent=\"AppDarkBaseTheme\">\n    <!--\n        All customizations that are NOT specific to a particular\n        API-level can go here.\n    -->\n\n    <item name=\"application\">@drawable/ic_stop_white_24dp</item>\n    <item name=\"external\">@drawable/ic_sd_storage_white_24dp</item>\n    <item name=\"file\">@drawable/ic_list_white_24dp</item>\n    <item name=\"folder\">@drawable/ic_folder_open_white_24dp</item>\n    <item name=\"audio\">@drawable/ic_volume_up_white_24dp</item>\n    <item name=\"image\">@drawable/ic_image_white_24dp</item>\n    <item name=\"parent\">@drawable/ic_reply_white_24dp</item>\n    <item name=\"video\">@drawable/ic_videocam_white_24dp</item>\n\n    <item name=\"edit\">@drawable/ic_edit_white_24dp</item>\n    <item name=\"open\">@drawable/ic_folder_open_white_24dp</item>\n    <item name=\"save\">@drawable/ic_save_white_24dp</item>\n    <item name=\"view\">@drawable/ic_list_white_24dp</item>\n    <item name=\"newFile\">@drawable/ic_add_white_24dp</item>\n\n    <item name=\"android:windowBackground\">@android:color/black</item>\n\n    <item name=\"android:textColorPrimary\">@android:color/white</item>\n    <item name=\"android:textColorSecondary\">@android:color/white</item>\n    <item name=\"android:textColorTertiary\">@android:color/white</item>\n\n  </style>\n\n  <!-- Application theme. -->\n  <style name=\"AppRetroTheme\" parent=\"AppDarkBaseTheme\">\n    <!--\n        All customizations that are NOT specific to a particular\n        API-level can go here.\n    -->\n\n    <item name=\"application\">@drawable/ic_stop_white_24dp</item>\n    <item name=\"external\">@drawable/ic_sd_storage_white_24dp</item>\n    <item name=\"file\">@drawable/ic_list_white_24dp</item>\n    <item name=\"folder\">@drawable/ic_folder_open_white_24dp</item>\n    <item name=\"audio\">@drawable/ic_volume_up_white_24dp</item>\n    <item name=\"image\">@drawable/ic_image_white_24dp</item>\n    <item name=\"parent\">@drawable/ic_reply_white_24dp</item>\n    <item name=\"video\">@drawable/ic_videocam_white_24dp</item>\n\n    <item name=\"edit\">@drawable/ic_edit_white_24dp</item>\n    <item name=\"open\">@drawable/ic_folder_open_white_24dp</item>\n    <item name=\"save\">@drawable/ic_save_white_24dp</item>\n    <item name=\"view\">@drawable/ic_list_white_24dp</item>\n    <item name=\"newFile\">@drawable/ic_add_white_24dp</item>\n\n    <item name=\"android:windowBackground\">@android:color/black</item>\n\n    <item name=\"android:textColorPrimary\">@color/text_color_retro</item>\n    <item name=\"android:textColorSecondary\">@color/text_color_retro</item>\n    <item name=\"android:textColorTertiary\">@color/text_color_retro</item>\n\n  </style>\n\n  <style name=\"DialogBaseTheme\" parent=\"android:Theme.Material.Light.Dialog\">\n    <!--\n        Theme customizations available in newer API levels can go in\n        res/values-vXX/styles.xml, while customizations related to\n        backward-compatibility can go here.\n    -->\n  </style>\n\n  <style name=\"DialogDarkBaseTheme\" parent=\"android:Theme.Material.Dialog\">\n    <!--\n        Theme customizations available in newer API levels can go in\n        res/values-vXX/styles.xml, while customizations related to\n        backward-compatibility can go here.\n    -->\n  </style>\n\n  <style name=\"DialogTheme\" parent=\"DialogBaseTheme\">\n    <!--\n        All customizations that are NOT specific to a particular\n        API-level can go here.\n    -->\n\n    <item name=\"application\">@drawable/ic_stop_black_24dp</item>\n    <item name=\"external\">@drawable/ic_sd_storage_black_24dp</item>\n    <item name=\"file\">@drawable/ic_list_black_24dp</item>\n    <item name=\"folder\">@drawable/ic_folder_open_black_24dp</item>\n    <item name=\"audio\">@drawable/ic_volume_up_black_24dp</item>\n    <item name=\"image\">@drawable/ic_image_black_24dp</item>\n    <item name=\"parent\">@drawable/ic_reply_black_24dp</item>\n    <item name=\"video\">@drawable/ic_videocam_black_24dp</item>\n\n    <item name=\"edit\">@drawable/ic_edit_white_24dp</item>\n    <item name=\"open\">@drawable/ic_folder_open_white_24dp</item>\n    <item name=\"save\">@drawable/ic_save_white_24dp</item>\n    <item name=\"view\">@drawable/ic_list_white_24dp</item>\n    <item name=\"newFile\">@drawable/ic_add_white_24dp</item>\n\n  </style>\n\n  <style name=\"DialogWhiteTheme\" parent=\"DialogBaseTheme\">\n    <!--\n        All customizations that are NOT specific to a particular\n        API-level can go here.\n    -->\n\n    <item name=\"application\">@drawable/ic_stop_black_24dp</item>\n    <item name=\"external\">@drawable/ic_sd_storage_black_24dp</item>\n    <item name=\"file\">@drawable/ic_list_black_24dp</item>\n    <item name=\"folder\">@drawable/ic_folder_open_black_24dp</item>\n    <item name=\"audio\">@drawable/ic_volume_up_black_24dp</item>\n    <item name=\"image\">@drawable/ic_image_black_24dp</item>\n    <item name=\"parent\">@drawable/ic_reply_black_24dp</item>\n    <item name=\"video\">@drawable/ic_videocam_black_24dp</item>\n\n    <item name=\"edit\">@drawable/ic_edit_black_24dp</item>\n    <item name=\"open\">@drawable/ic_folder_open_black_24dp</item>\n    <item name=\"save\">@drawable/ic_save_black_24dp</item>\n    <item name=\"view\">@drawable/ic_list_black_24dp</item>\n    <item name=\"newFile\">@drawable/ic_add_black_24dp</item>\n\n    <item name=\"android:textColorPrimary\">@android:color/black</item>\n    <item name=\"android:textColorSecondary\">@android:color/black</item>\n    <item name=\"android:textColorTertiary\">@android:color/black</item>\n\n  </style>\n\n  <style name=\"DialogDarkTheme\" parent=\"DialogDarkBaseTheme\">\n    <!--\n        All customizations that are NOT specific to a particular\n        API-level can go here.\n    -->\n\n    <item name=\"application\">@drawable/ic_stop_white_24dp</item>\n    <item name=\"external\">@drawable/ic_sd_storage_white_24dp</item>\n    <item name=\"file\">@drawable/ic_list_white_24dp</item>\n    <item name=\"folder\">@drawable/ic_folder_open_white_24dp</item>\n    <item name=\"audio\">@drawable/ic_volume_up_white_24dp</item>\n    <item name=\"image\">@drawable/ic_image_white_24dp</item>\n    <item name=\"parent\">@drawable/ic_reply_white_24dp</item>\n    <item name=\"video\">@drawable/ic_videocam_white_24dp</item>\n\n    <item name=\"edit\">@drawable/ic_edit_white_24dp</item>\n    <item name=\"open\">@drawable/ic_folder_open_white_24dp</item>\n    <item name=\"save\">@drawable/ic_save_white_24dp</item>\n    <item name=\"view\">@drawable/ic_list_white_24dp</item>\n    <item name=\"newFile\">@drawable/ic_add_white_24dp</item>\n\n  </style>\n\n  <style name=\"DialogBlackTheme\" parent=\"DialogDarkBaseTheme\">\n    <!--\n        All customizations that are NOT specific to a particular\n        API-level can go here.\n    -->\n\n    <item name=\"application\">@drawable/ic_stop_white_24dp</item>\n    <item name=\"external\">@drawable/ic_sd_storage_white_24dp</item>\n    <item name=\"file\">@drawable/ic_list_white_24dp</item>\n    <item name=\"folder\">@drawable/ic_folder_open_white_24dp</item>\n    <item name=\"audio\">@drawable/ic_volume_up_white_24dp</item>\n    <item name=\"image\">@drawable/ic_image_white_24dp</item>\n    <item name=\"parent\">@drawable/ic_reply_white_24dp</item>\n    <item name=\"video\">@drawable/ic_videocam_white_24dp</item>\n\n    <item name=\"edit\">@drawable/ic_edit_white_24dp</item>\n    <item name=\"open\">@drawable/ic_folder_open_white_24dp</item>\n    <item name=\"save\">@drawable/ic_save_white_24dp</item>\n    <item name=\"view\">@drawable/ic_list_white_24dp</item>\n    <item name=\"newFile\">@drawable/ic_add_white_24dp</item>\n\n    <item name=\"android:textColorPrimary\">@android:color/white</item>\n    <item name=\"android:textColorSecondary\">@android:color/white</item>\n    <item name=\"android:textColorTertiary\">@android:color/white</item>\n\n  </style>\n\n  <style name=\"DialogRetroTheme\" parent=\"DialogDarkBaseTheme\">\n    <!--\n        All customizations that are NOT specific to a particular\n        API-level can go here.\n    -->\n\n    <item name=\"application\">@drawable/ic_stop_white_24dp</item>\n    <item name=\"external\">@drawable/ic_sd_storage_white_24dp</item>\n    <item name=\"file\">@drawable/ic_list_white_24dp</item>\n    <item name=\"folder\">@drawable/ic_folder_open_white_24dp</item>\n    <item name=\"audio\">@drawable/ic_volume_up_white_24dp</item>\n    <item name=\"image\">@drawable/ic_image_white_24dp</item>\n    <item name=\"parent\">@drawable/ic_reply_white_24dp</item>\n    <item name=\"video\">@drawable/ic_videocam_white_24dp</item>\n\n    <item name=\"edit\">@drawable/ic_edit_white_24dp</item>\n    <item name=\"open\">@drawable/ic_folder_open_white_24dp</item>\n    <item name=\"save\">@drawable/ic_save_white_24dp</item>\n    <item name=\"view\">@drawable/ic_list_white_24dp</item>\n    <item name=\"newFile\">@drawable/ic_add_white_24dp</item>\n\n    <item name=\"android:textColorPrimary\">@color/text_color_retro</item>\n    <item name=\"android:textColorSecondary\">@color/text_color_retro</item>\n    <item name=\"android:textColorTertiary\">@color/text_color_retro</item>\n\n  </style>\n\n</resources>\n"
  },
  {
    "path": "src/main/res/values-ar/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    tools:ignore=\"\">\n\n  <string name=\"appName\">Editor</string>\n\n  <string name=\"newFile\">ملف جديد</string>\n  <string name=\"openFile\">فتح ملف</string>\n  <string name=\"name\">الاسم</string>\n  <string name=\"path\">المسار</string>\n  <string name=\"create\">إنشاء</string>\n  <string name=\"edit\">تعديل</string>\n  <string name=\"view\">عرض</string>\n  <string name=\"open\">فتح ملف…</string>\n  <string name=\"save\">حفظ</string>\n  <string name=\"storage\">الذاكرة</string>\n  <string name=\"openRecent\">المفتوحة مؤخرا</string>\n  <string name=\"clearList\">تنظيف القائمة</string>\n  <string name=\"search\">بحث…</string>\n  <string name=\"findAll\">إيجاد الكل…</string>\n  <string name=\"saveAs\">الحفظ ك…</string>\n  <string name=\"detect\">اكتشاف</string>\n  <string name=\"goTo\">الذهاب إلى…</string>\n  <string name=\"print\">طباعة…</string>\n  <string name=\"viewMarkdown\">عرض markdown…</string>\n  <string name=\"options\">الخيارات</string>\n  <string name=\"viewFile\">عرض الملفات</string>\n  <string name=\"openLast\">الفتح على الأخير</string>\n  <string name=\"autoSave\">الحفظ التلقاءي</string>\n  <string name=\"wrap\">تقسيم الأسطر الطويلة</string>\n  <string name=\"suggest\">الاقتراحات</string>\n  <string name=\"highlight\">تمييز بناء الجملة</string>\n  <string name=\"theme\">السمة</string>\n  <string name=\"light\">مضيء</string>\n  <string name=\"dark\">مظلم</string>\n  <string name=\"system\">النظام</string>\n  <string name=\"white\">أبيض</string>\n  <string name=\"black\">أسود</string>\n  <string name=\"retro\">قديم</string>\n  <string name=\"size\">حجم النص</string>\n  <string name=\"small\">صغير</string>\n  <string name=\"medium\">متوسط</string>\n  <string name=\"large\">ضخم</string>\n  <string name=\"typeface\">نوع الخط</string>\n  <string name=\"mono\">Monospace</string>\n  <string name=\"normal\">Proportional</string>\n  <string name=\"sans\">Sans serif</string>\n  <string name=\"serif\">Serif</string>\n  <string name=\"about\">حول</string>\n\n  <!--\n      Note for translators: You don't need to translate all these\n      translation credits below. Just the version, copyright, credit\n      for your translation and the licence. Also add your translation\n      credit here.\n  -->\n  <string name=\"version\" formatted=\"false\"><a href=\"https://github.com/billthefarmer/editor/releases/latest\">%s</a>\\n\\nBuilt %s\\n\\nحقوق طبع \\u00A9 2017 <a href=\"https://github.com/billthefarmer\">Bill Farmer</a>\\n\\nArabic translation by <a href=\"https://github.com/MuhammedSaleem-Brej\">MuhammedSaleem brej</a>,French translation by <a href=\"https://github.com/milouse\">Étienne Deparis</a>, German translation by <a href=\"https://github.com/Markus00000\">Markus Weimar</a> and <a href=\"https://github.com/AlexanderRitter02\">Alexander Ritter</a>, Italian translation by <a href=\"https://github.com/airon90\">Michael Moroni</a>, Polish translation by <a href=\"https://github.com/evo16\">Evo</a>, Greek translation by <a href=\"https://github.com/nikoss\">nikoss</a>, Spanish translation by <a href=\"https://github.com/foxneo\">Miguel Caceres</a>, Simplified Chinese translation by <a href=\"https://github.com/ludoux\">Lu Chang (ludoux)</a>, Dutch translation by <a href=\"https://github.com/Vistaus\">Heimen Stoffels (vistaus)</a>, Russian translation by <a href=\"https://github.com/bboa\">Igor Nedoboy</a>, Latvian translation by <a href=\"https://github.com/rhssk\">Rihards Skuja</a>, Icelandic translation by <a href=\"\">Sveinn í Felli</a>, Portuguese translation by <a href=\"https://github.com/Andre-Gloria\" >André Glória</a>, Chinese (Taiwan) translation by <a href=\"https://github.com/cges30901\">cges30901</a>, Turkish translation by <a href=\"https://github.com/yasarciv67\">Yaşar Çiv</a>, Brazilian Portuguese translation by <a href=\"https://github.com/aevw\">aevw</a>, Sorani Kurdish translation by <a href=\"https://github.com/rawandsaeed\">Rawand Saeed</a>, Persian (Farsi) translation by <a href=\"https://github.com/eshagh79\">Eshagh</a>, Hungarian translation by <a href=\"https://github.com/urbalazs\">Balázs Úr</a>, Japanese translation by <a href=\"https://gitlab.com/dokutoku\">dokutoku</a>, Belarusian translation by <a href=\"https://github.com/Atrafon\">Makar Razin</a>, Basque (eu) translation by <a href=\"https://github.com/alexgabi\">alexgabi</a>\\n\\nالرخصة <a href=\"https://www.gnu.org/licenses/gpl.txt\">GNU GPLv3</a>\n  </string>\n\n  <string name=\"tooLarge\">ضخم جدا %s</string>\n  <string name=\"choose\"></string>\n  <string name=\"loading\">تتم المعالجة…</string>\n\n  <string name=\"modified\">\n    هناك تعديلات غير محفوظة، هل تريد حفظها؟\n  </string>\n\n  <string name=\"changedReload\">\n    لقد تم تعديل هذا الملف، هل تريد إعادة تحميله؟\n  </string>\n\n  <string name=\"changedOverwrite\">\n    لقد تم تعديل هذا الملف، هل تريد الكتابة فوقه؟\n  </string>\n\n  <string name=\"ok\">حسنا</string>\n  <string name=\"reload\">إعادة التحميل</string> \n  <string name=\"overwrite\">الكتابة فوق</string>\n  <string name=\"discard\">تجاهل</string>\n  <string name=\"cancel\">إلغاء</string>\n\n</resources>\n"
  },
  {
    "path": "src/main/res/values-be/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n\n  <string name=\"appName\">Рэдактар</string>\n\n  <string name=\"search\">Пошук…</string>\n  <string name=\"openFile\">Адкрыць файл</string>\n  <string name=\"name\">Імя</string>\n  <string name=\"path\">Шлях</string>\n  <string name=\"create\">Ствараць</string>\n  <string name=\"findAll\">Знайсці ўсё…</string>\n  <string name=\"newFile\">Новы</string>\n  <string name=\"edit\">Рэдактар</string>\n  <string name=\"view\">Прагляд</string>\n  <string name=\"open\">Адкрыць файл…</string>\n  <string name=\"save\">Захаваць</string>\n  <string name=\"storage\">Сховішча</string>\n  <string name=\"openRecent\">Нядаўнія</string>\n  <string name=\"clearList\">Ачысціць спіс</string>\n  <string name=\"saveAs\">Захаваць як…</string>\n  <string name=\"detect\">Выяўляць</string>\n  <string name=\"goTo\">Перайсці да…</string>\n  <string name=\"print\">Друкаваць…</string>\n  <string name=\"viewMarkdown\">Прагляд Markdown…</string>\n  <string name=\"options\">Параметры</string>\n  <string name=\"viewFile\">Прагляд файлаў</string>\n  <string name=\"openLast\">Адкрыты апошнім</string>\n  <string name=\"autoSave\">Аўтазахаванне</string>\n  <string name=\"wrap\">Перанос радкоў</string>\n  <string name=\"suggest\">Варыянты слоў</string>\n  <string name=\"highlight\">Вылучыць сінтаксіс</string>\n  <string name=\"theme\">Тэма</string>\n  <string name=\"light\">Светлая</string>\n  <string name=\"dark\">Цёмная</string>\n  <string name=\"white\">Белая</string>\n  <string name=\"black\">Чорная</string>\n  <string name=\"system\">Сістэмная</string>\n  <string name=\"retro\">Рэтра</string>\n  <string name=\"size\">Памер шрыфта</string>\n  <string name=\"small\">Малы</string>\n  <string name=\"medium\">Сярэдні</string>\n  <string name=\"large\">Буйны</string>\n  <string name=\"typeface\">Шрыфт</string>\n  <string name=\"mono\">Манашырынны</string>\n  <string name=\"normal\">Прапарцыйны</string>\n  <string name=\"sans\">Без засечак</string>\n  <string name=\"serif\">З засечкамі</string>\n  <string name=\"about\">Аб праграме</string>\n\n  <string name=\"version\" formatted=\"false\"><a\n  href=\"https://github.com/billthefarmer/editor/releases/latest\">%s</a>\\n\\nЗборка\n  %s\\nРаспрацоўка \\u00A9 2017 Bill Farmer\\n\\nБеларускі пераклад \\u00A9 <a\n  href=\"https://github.com/Atrafon\">Makar Razin</a>\\n\\nЛіцэнзія <a\n  href=\"https://www.gnu.org/licenses/gpl.txt\">GNU GPLv3</a>\n  </string>\n\n  <string name=\"tooLarge\">Занадта вялікі %s</string>\n  <string name=\"choose\">Выберыце імя файла</string>\n  <string name=\"loading\">Чытанне…</string>\n\n  <string name=\"modified\">\n    Захаваць змены?\n  </string>\n\n  <string name=\"changedReload\">\n    Файл змяніўся, перачытаць?\n  </string>\n\n  <string name=\"changedOverwrite\">\n    Файл змяніўся, перазапісаць?\n  </string>\n\n  <string name=\"ok\">ОК</string>\n  <string name=\"reload\">Перачытаць</string>\n  <string name=\"overwrite\">Перазапісаць</string>\n  <string name=\"discard\">Не захоўваць</string>\n  <string name=\"cancel\">Адмена</string>\n\n</resources>\n"
  },
  {
    "path": "src/main/res/values-de/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n\n  <string name=\"appName\">Editor</string>\n\n  <string name=\"newFile\">Neu</string>\n  <string name=\"openFile\">Datei öffnen</string>\n  <string name=\"name\">Name</string>\n  <string name=\"path\">Pfad</string>\n  <string name=\"create\">Erstellen</string>\n  <string name=\"edit\">Bearbeiten</string>\n  <string name=\"view\">Betrachten</string>\n  <string name=\"open\">Datei öffnen…</string>\n  <string name=\"save\">Speichern</string>\n  <string name=\"storage\">Speicher</string>\n  <string name=\"openRecent\">Zuletzt geöffnet</string>\n  <string name=\"clearList\">Liste leeren</string>\n  <string name=\"search\">Suchen…</string>\n  <string name=\"findAll\">Alle finden…</string>\n  <string name=\"saveAs\">Speichern unter…</string>\n  <string name=\"detect\">Erkennen</string>\n  <string name=\"goTo\">Gehe zu…</string>\n  <string name=\"print\">Drucken…</string>\n  <string name=\"viewMarkdown\">Markdown betrachten…</string>\n  <string name=\"options\">Optionen</string>\n  <string name=\"viewFile\">Dateien anzeigen</string>\n  <string name=\"openLast\">Zuletzt geöffnet</string>\n  <string name=\"autoSave\">Automatisch speichern</string>\n  <string name=\"wrap\">Zeilenumbruch</string>\n  <string name=\"suggest\">Vorschläge</string>\n  <string name=\"highlight\">Syntax hervorheben</string>\n  <string name=\"theme\">Thema</string>\n  <string name=\"light\">Hell</string>\n  <string name=\"dark\">Dunkel</string>\n  <string name=\"system\">System</string>\n  <string name=\"white\">Weiß</string>\n  <string name=\"black\">Schwarz</string>\n  <string name=\"retro\">Retro</string>\n  <string name=\"size\">Schriftgröße</string>\n  <string name=\"small\">Klein</string>\n  <string name=\"medium\">Mittel</string>\n  <string name=\"large\">Groß</string>\n  <string name=\"typeface\">Schriftart</string>\n  <string name=\"mono\">Nichtproportional</string>\n  <string name=\"normal\">Proportional</string>\n  <string name=\"sans\">Serifenlos</string>\n  <string name=\"serif\">Serife</string>\n  <string name=\"about\">Über</string>\n\n  <string name=\"version\" formatted=\"false\"><a\n  href=\"https://github.com/billthefarmer/editor/releases/latest\">%s</a>\\n\\nBuild\n  %s\\n\\nCopyright \\u00A9 2017 Bill Farmer\\n\\nDeutsche Übersetzung von\n  <a href=\"https://github.com/Markus00000\">Markus Weimar</a> und\n  <a href=\"https://github.com/AlexanderRitter02\">Alexander Ritter</a>\\n\\nLizenz\n  <a href=\"https://www.gnu.org/licenses/gpl.txt\">GNU GPLv3</a>\n  </string>\n\n  <string name=\"tooLarge\">Zu groß %s</string>\n  <string name=\"choose\">Geben Sie einen Dateinamen ein.</string>\n  <string name=\"loading\">Laden…</string>\n\n  <string name=\"modified\">\n    Ihre Änderungen wurden noch nicht gespeichert. Möchten Sie diese speichern?\n  </string>\n\n  <string name=\"changedReload\">\n    Die Datei wurde geändert. Möchten Sie diese neu laden?\n  </string>\n\n  <string name=\"changedOverwrite\">\n    Die Datei wurde geändert. Möchten Sie diese überschreiben?\n  </string>\n\n  <string name=\"ok\">OK</string>\n  <string name=\"reload\">Neu laden</string>\n  <string name=\"overwrite\">Überschreiben</string>\n  <string name=\"discard\">Verwerfen</string>\n  <string name=\"cancel\">Abbrechen</string>\n\n</resources>\n"
  },
  {
    "path": "src/main/res/values-el/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n\n  <string name=\"appName\">Επεξεργαστής</string>\n\n  <string name=\"newFile\">Νέος</string>\n  <string name=\"openFile\">Άνοιγμα αρχείου</string>\n  <string name=\"name\">Όνομα</string>\n  <string name=\"path\">Μονοπάτι</string>\n  <string name=\"create\">Δημιουργώ</string>\n  <string name=\"edit\">Επεξεργασία</string>\n  <string name=\"view\">Προβολή</string>\n  <string name=\"open\">Άνοιγμα αρχείου…</string>\n  <string name=\"save\">Αποθήκευση</string>\n  <string name=\"storage\">Αποθηκευτικός χώρος</string>\n  <string name=\"openRecent\">Άνοιγμα πρόσφατου</string>\n  <string name=\"clearList\">Σαφή κατάλογο</string>\n  <string name=\"search\">Αναζήτηση…</string>\n  <string name=\"findAll\">Βρείτε όλα…</string>\n  <string name=\"saveAs\">Αποθήκευση ως…</string>\n  <string name=\"detect\">Ανιχνεύουν</string>\n  <string name=\"goTo\">Πήγαινε στο…</string>\n  <string name=\"print\">Τυπώνω…</string>\n  <string name=\"viewMarkdown\">Προβολή της Markdown…</string>\n  <string name=\"options\">Επιλογές</string>\n  <string name=\"viewFile\">Προβολή αρχείων</string>\n  <string name=\"openLast\">Ανοιχτό τελευταίο</string>\n  <string name=\"autoSave\">Αυτόματη αποθήκευση</string>\n  <string name=\"wrap\">Αναδίπλωση λέξεων</string>\n  <string name=\"suggest\">Προτάσεις</string>\n  <string name=\"highlight\">Επισήμανση σύνταξης</string>\n  <string name=\"theme\">Θέμα</string>\n  <string name=\"light\">Φωτεινό</string>\n  <string name=\"white\">Άσπρος</string>\n  <string name=\"dark\">Σκοτεινό</string>\n  <string name=\"black\">Μαύρος</string>\n  <string name=\"system\">Σύστημα</string>\n  <string name=\"retro\">Παλιότροπο</string>\n  <string name=\"size\">Μέγεθος κειμένου</string>\n  <string name=\"small\">Μικρό</string>\n  <string name=\"medium\">Μεσαίο</string>\n  <string name=\"large\">Μεγάλο</string>\n  <string name=\"typeface\">Γραμματοσειρά</string>\n  <string name=\"mono\">Σταθερού πλάτους</string>\n  <string name=\"normal\">Αναλογική</string>\n  <string name=\"sans\">Χωρίς σερίφ</string>\n  <string name=\"serif\">Σερίφ</string>\n  <string name=\"about\">Σχετικά με…</string>\n\n  <string name=\"version\" formatted=\"false\"><a\n  href=\"https://github.com/billthefarmer/editor/releases/latest\">%s</a>\\n\\nΣύνθεση\n  %s\\n\\nΠνευματικά δικαιώματα \\u00A9 2017 Bill Farmer\\n\\nΕλληνική\n  μετάφραση από <a\n  href=\"https://github.com/nikoss\">nikoss</a>\\n\\nΆδεια <a\n  href=\"https://www.gnu.org/licenses/gpl.txt\">GNU GPLv3</a></string>\n\n  <string name=\"tooLarge\">Πολύ μεγάλο %s</string>\n  <string name=\"choose\">Επέλεξε ένα όνομα αρχείου</string>\n  <string name=\"loading\">Φορτώνει…</string>\n\n  <string name=\"modified\">Υπάρχουν μη αποθηκευμένες αλλαγές.\\nΘα\n  ήθελες να αποθηκεύσεις τις αλλαγές σου;</string>\n\n  <string name=\"changedReload\">Αυτό το αρχείο έχει αλλάξει.\\nΘα ήθελες\n  να ξαναφορτωθεί;</string>\n\n  <string name=\"changedOverwrite\">Αυτό το αρχείο έχει αλλάξει.\\nΘα\n  ήθελες να επανωγραφεί;</string>\n\n  <string name=\"ok\">Εντάξει</string>\n  <string name=\"reload\">Επαναφόρτωση</string>\n  <string name=\"overwrite\">Επανωγραφή</string>\n  <string name=\"discard\">Απόρριψη</string>\n  <string name=\"cancel\">Ακύρωση</string>\n\n</resources>\n"
  },
  {
    "path": "src/main/res/values-es/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n\n  <string name=\"appName\">Editor</string>\n\n  <string name=\"newFile\">Nuevo</string>\n  <string name=\"openFile\">Abrir archivo</string>\n  <string name=\"name\">Nombre</string>\n  <string name=\"path\">Camino</string>\n  <string name=\"create\">Crear</string>\n  <string name=\"edit\">Editar</string>\n  <string name=\"view\">Ver</string>\n  <string name=\"open\">Abrir archivo…</string>\n  <string name=\"save\">Guardar</string>\n  <string name=\"storage\">Almacenamiento</string>\n  <string name=\"openRecent\">Abierto por última vez</string>\n  <string name=\"clearList\">Limpiar lista</string>\n  <string name=\"search\">Buscar…</string>\n  <string name=\"findAll\">Encuentra todos…</string>\n  <string name=\"saveAs\">Guardar como…</string>\n  <string name=\"detect\">Detectar</string>\n  <string name=\"goTo\">Vete a…</string>\n  <string name=\"print\">Imprimir…</string>\n  <string name=\"viewMarkdown\">Ver markdown…</string>\n  <string name=\"options\">Opciones</string>\n  <string name=\"viewFile\">Mostrar archivo</string>\n  <string name=\"openLast\">Abrir último</string>\n  <string name=\"autoSave\">Guardado automático</string>\n  <string name=\"wrap\">Salto de línea</string>\n  <string name=\"suggest\">Recomendaciones</string>\n  <string name=\"highlight\">Marcar la sintaxis</string>\n  <string name=\"theme\">Tema</string>\n  <string name=\"light\">Claro</string>\n  <string name=\"dark\">Oscuro</string>\n  <string name=\"system\">Sistema</string>\n  <string name=\"white\">Blanco</string>\n  <string name=\"black\">Negro</string>\n  <string name=\"retro\">Retro</string>\n  <string name=\"size\">Tamaño del texto</string>\n  <string name=\"small\">Pequeño</string>\n  <string name=\"medium\">Medio</string>\n  <string name=\"large\">Grande</string>\n  <string name=\"typeface\">Fuente</string>\n  <string name=\"mono\">Monospace</string>\n  <string name=\"normal\">Proporciónal</string>\n  <string name=\"sans\">Palo seco</string>\n  <string name=\"serif\">Serifa</string>\n  <string name=\"about\">Acerca de</string>\n\n  <string name=\"version\" formatted=\"false\"><a\n  href=\"https://github.com/billthefarmer/editor/releases/latest\">%s</a>\\n\\nBuild\n  %s\\n\\nCopyright \\u00A9 2019 Bill Farmer\\n\\nTraducción al Español por\n  <a href=\"https://github.com/foxneo\">Miguel Caceres</a>\\n\\nLicencia\n  <a href=\"https://www.gnu.org/licenses/gpl.txt\">GNU GPLv3</a>\n  </string>\n\n  <string name=\"tooLarge\">Demasiado grande %s</string>\n  <string name=\"choose\">Ingresa el nombre del archivo</string>\n  <string name=\"loading\">Cargando…</string>\n\n  <string name=\"modified\">\n    Cambios en el archivo no han sido guardados. Deseas gurdarlos?\n  </string>\n\n  <string name=\"changedReload\">\n    El archivo ha sido modificado. Deseas actualizarlo?\n  </string>\n\n  <string name=\"changedOverwrite\">\n    El archivo ha sido modificado. Deseas sobreescribirlo?\n  </string>\n\n  <string name=\"ok\">OK</string>\n  <string name=\"reload\">Actualizar</string>\n  <string name=\"overwrite\">Sobreescribir</string>\n  <string name=\"discard\">Descartar</string>\n  <string name=\"cancel\">Cancelar</string>\n\n</resources>\n"
  },
  {
    "path": "src/main/res/values-eu/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n\n  <string name=\"appName\">Editor</string>\n\n  <string name=\"newFile\">Berria</string>\n  <string name=\"openFile\">Fitxategia ireki</string>\n  <string name=\"name\">Izena</string>\n  <string name=\"path\">Bidea</string>\n  <string name=\"create\">Sortu</string>\n  <string name=\"edit\">Editatu</string>\n  <string name=\"view\">Ikusi</string>\n  <string name=\"open\">Ireki fitxategia…</string>\n  <string name=\"save\">Gorde</string>\n  <string name=\"storage\">Biltegiratzea</string>\n  <string name=\"openRecent\">Ireki azkena</string>\n  <string name=\"clearList\">Garbitu zerrenda</string>\n  <string name=\"search\">Bilatu…</string>\n  <string name=\"findAll\">Aurkitu guztiak…</string>\n  <string name=\"saveAs\">Gorde honela…</string>\n  <string name=\"detect\">Atzeman</string>\n  <string name=\"goTo\">Joan hona…</string>\n  <string name=\"print\">Inprimatu…</string>\n  <string name=\"viewMarkdown\">Ikusi markdown…</string>\n  <string name=\"options\">Aukerak</string>\n  <string name=\"viewFile\">Erakutsi fitxategia</string>\n  <string name=\"openLast\">Ireki azkena</string>\n  <string name=\"autoSave\">Gorde automatikoki</string>\n  <string name=\"wrap\">Lerro-jausia</string>\n  <string name=\"suggest\">Gomendioak</string>\n  <string name=\"highlight\">Markatu sintaxia</string>\n  <string name=\"theme\">Gaia</string>\n  <string name=\"light\">Argia</string>\n  <string name=\"dark\">Iluna</string>\n  <string name=\"system\">Sistema</string>\n  <string name=\"white\">Zuria</string>\n  <string name=\"black\">Beltza</string>\n  <string name=\"retro\">Retroa</string>\n  <string name=\"size\">Testuaren tamaina</string>\n  <string name=\"small\">Txikia</string>\n  <string name=\"medium\">Tartekoa</string>\n  <string name=\"large\">Handia</string>\n  <string name=\"typeface\">Letra-tipoa</string>\n  <string name=\"mono\">Monoespazioa</string>\n  <string name=\"normal\">Proportzionala</string>\n  <string name=\"sans\">Makila lehorra</string>\n  <string name=\"serif\">Serifa</string>\n  <string name=\"about\">Honi buruz</string>\n\n  <string name=\"version\" formatted=\"false\"><a\n  href=\"https://github.com/billthefarmer/editor/releases/latest\">%s</a>\\n\\nBuild\n  %s\\n\\nCopyright \\u00A9 2019 Bill Farmer\\n\\nEuskarara itzulia\n  <a href=\"https://github.com/foxneo\">Alexander Gabilondo</a>\\n\\nLicentzia\n  <a href=\"https://www.gnu.org/licenses/gpl.txt\">GNU GPLv3</a>\n  </string>\n\n  <string name=\"tooLarge\">%s luzeegia</string>\n  <string name=\"choose\">Sartu fitxategiaren izena</string>\n  <string name=\"loading\">Kargatzen…</string>\n\n  <string name=\"modified\">\n    Fitxategiko aldaketak oraindik ez dira gorde. Gorde nahi dituzu?\n  </string>\n\n  <string name=\"changedReload\">\n    Fitxategia aldatu da. Eguneratu nahi duzu?\n  </string>\n\n  <string name=\"changedOverwrite\">\n    Fitxategia aldatu da. Gainidatzi nahi duzu?\n  </string>\n\n  <string name=\"ok\">Ados</string>\n  <string name=\"reload\">Eguneratu</string>\n  <string name=\"overwrite\">Gainidatzi</string>\n  <string name=\"discard\">Baztertu</string>\n  <string name=\"cancel\">Utzi</string>\n\n</resources>\n"
  },
  {
    "path": "src/main/res/values-fa/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n\n  <string name=\"appName\">ویرایشگر</string>\n\n  <string name=\"newFile\">جدید</string>\n  <string name=\"openFile\">باز کردن پرونده</string>\n  <string name=\"name\">نام</string>\n  <string name=\"path\">مسیر</string>\n  <string name=\"create\">ایجاد</string>\n  <string name=\"edit\">ویرایش</string>\n  <string name=\"view\">نمایش</string>\n  <string name=\"open\">باز کردن پرونده…</string>\n  <string name=\"save\">ذخیره</string>\n  <string name=\"storage\">انبار</string>\n  <string name=\"openRecent\">اخیرا باز شده</string>\n  <string name=\"clearList\">پاک کردن فهرست</string>\n  <string name=\"search\">جست‌وجو</string>\n  <string name=\"findAll\">یافتن همه…</string>\n  <string name=\"detect\">تشخیص</string>\n  <string name=\"goTo\">برو به…</string>\n  <string name=\"saveAs\">ذخیره به عنوان…</string>\n  <string name=\"print\">چاپ…</string>\n  <string name=\"viewMarkdown\">نمایش مارک‌داون…</string>\n  <string name=\"options\">گزینه</string>\n  <string name=\"viewFile\">نمایش پرونده‌ها</string>\n  <string name=\"openLast\">باز کردن اخرین</string>\n  <string name=\"autoSave\">ذخیره خودکار</string>\n  <string name=\"wrap\">پیچیدن کلمات</string>\n  <string name=\"suggest\">پیشنهادات</string>\n  <string name=\"highlight\">برجسته کردن سینتکس</string>\n  <string name=\"theme\">شِما</string>\n  <string name=\"light\">روشن</string>\n  <string name=\"dark\">تاریک</string>\n  <string name=\"system\">سیستم</string>\n  <string name=\"white\">سفید</string>\n  <string name=\"black\">سیاه</string>\n  <string name=\"retro\">معکوس</string>\n  <string name=\"size\">اندازه قلم</string>\n  <string name=\"small\">کوچک</string>\n  <string name=\"medium\">متوسط</string>\n  <string name=\"large\">بزرگ</string>\n  <string name=\"typeface\">سبک حروف</string>\n  <string name=\"mono\">تک فاصله</string>\n  <string name=\"normal\">متناسب</string>\n  <string name=\"sans\">بدون سریف</string>\n  <string name=\"serif\">سریف</string>\n  <string name=\"about\">درباره</string>\n\n  <!--\n      Note for translators: You don't need to translate all these\n      translation credits below. Just the version, copyright, credit\n      for your translation and the licence. Also add your translation\n      credit here.\n  -->\n  <string name=\"version\" formatted=\"false\"><a href=\"https://github.com/billthefarmer/editor/releases/latest\">%s</a>\\n\\nساخته شده در %s\\n\\nحق چاپ \\u00A9 ۲۰۱۷ <a href=\"https://github.com/billthefarmer\">Bill Farmer</a>\\n\\nترجمه فرانسوی توسط <a href=\"https://github.com/milouse\">Étienne Deparis</a>, ترجمه آلمانی توسط <a href=\"https://github.com/Markus00000\">Markus Weimar</a> و <a href=\"https://github.com/AlexanderRitter02\">Alexander Ritter</a>, ترجمه ایتالیایی توسط <a href=\"https://github.com/airon90\">Michael Moroni</a>, ترجمه لهستانی توسط <a href=\"https://github.com/evo16\">Evo</a>, ترجمه یونانی توسط <a href=\"https://github.com/nikoss\">nikoss</a>, ترجمه اسپانیایی توسط <a href=\"https://github.com/foxneo\">Miguel Caceres</a>, ترجمه چینی ساده شده توسط <a href=\"https://github.com/ludoux\">Lu Chang (ludoux)</a>, ترجمه هلندی توسط <a href=\"https://github.com/Vistaus\">Heimen Stoffels (vistaus)</a>, ترجمه روسی توسط <a href=\"https://github.com/bboa\">Igor Nedoboy</a>, ترجمه لتونیایی توسط <a href=\"https://github.com/rhssk\">Rihards Skuja</a>, ترجمه ایسلندی توسط <a href=\"\">Sveinn í Felli</a>, ترجمه پرتغالی توسط <a href=\"https://github.com/Andre-Gloria\" >André Glória</a>, ترجمه چینی (تایوان) توسط <a href=\"https://github.com/cges30901\">cges30901</a>, ترجمه ترکی توسط <a href=\"https://github.com/yasarciv67\">Yaşar Çiv</a>, ترجمه پرتغالی برزیل توسط <a href=\"https://github.com/aevw\">aevw</a>, ترجمه کردی سورانی توسط <a href=\"https://github.com/rawandsaeed\">Rawand Saeed</a>, ترجمه فارسی توسط <a href=\"https://github.com/eshagh79\">eshagh79</a>\\n\\nپروانه <a href=\"https://www.gnu.org/licenses/gpl.txt\">GNU GPLv3</a>\n  </string>\n\n  <string name=\"tooLarge\">خیلی بزرگ %s</string>\n  <string name=\"choose\">یک نام برای پرونده انتخاب کنید</string>\n  <string name=\"loading\">در حال بارگزاری…</string>\n\n  <string name=\"modified\">\n    شما تغییرات ذخیره نشده‌ای دارید. آیا می خواهید تغییرات خود را ذخیره کنید؟\n  </string>\n\n  <string name=\"changedReload\">\n    این پرونده تغییر کرده است، آیا می خواهید آن را دوباره بارگزاری کنید؟\n  </string>\n\n  <string name=\"changedOverwrite\">\n    این پرونده تغییر کرده است، آیا می خواهید آن را بازنویسی کنید؟\n  </string>\n\n  <string name=\"ok\">خوب</string>\n  <string name=\"reload\">بارگزاری مجدد</string>\n  <string name=\"overwrite\">بازنویسی</string>\n  <string name=\"discard\">دور انداختن</string>\n  <string name=\"cancel\">لغو</string>\n\n</resources>\n"
  },
  {
    "path": "src/main/res/values-fr/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n\n  <string name=\"appName\">Editor</string>\n\n  <string name=\"newFile\">Nouveau</string>\n  <string name=\"openFile\">Ouvrir un fichier</string>\n  <string name=\"name\">Nom</string>\n  <string name=\"path\">Chemin</string>\n  <string name=\"create\">Créer</string>\n  <string name=\"edit\">Modifier</string>\n  <string name=\"view\">Voir</string>\n  <string name=\"open\">Ouvrir un fichier…</string>\n  <string name=\"save\">Enregistrer</string>\n  <string name=\"storage\">Stockage</string>\n  <string name=\"openRecent\">Fichiers récents</string>\n  <string name=\"clearList\">Effacer la liste</string>\n  <string name=\"search\">Chercher…</string>\n  <string name=\"findAll\">Chercher partout…</string>\n  <string name=\"saveAs\">Enregistrer sous…</string>\n  <string name=\"detect\">Détecter</string>\n  <string name=\"goTo\">Atteindre…</string>\n  <string name=\"print\">Imprimer…</string>\n  <string name=\"viewMarkdown\">Compiler markdown…</string>\n  <string name=\"options\">Options</string>\n  <string name=\"viewFile\">Afficher les fichiers</string>\n  <string name=\"openLast\">Ouvrir en dernier</string>\n  <string name=\"autoSave\">Enregistrement auto</string>\n  <string name=\"wrap\">Retour à la ligne auto</string>\n  <string name=\"suggest\">Suggestions</string>\n  <string name=\"highlight\">Surligner la syntaxe</string>\n  <string name=\"theme\">Thème</string>\n  <string name=\"light\">Clair</string>\n  <string name=\"dark\">Foncé</string>\n  <string name=\"system\">Système</string>\n  <string name=\"white\">Blanc</string>\n  <string name=\"black\">Noir</string>\n  <string name=\"retro\">Rétro</string>\n  <string name=\"size\">Taille de la police</string>\n  <string name=\"small\">Petite</string>\n  <string name=\"medium\">Moyenne</string>\n  <string name=\"large\">Grande</string>\n  <string name=\"typeface\">Type de police</string>\n  <string name=\"mono\">Chasse fixe</string>\n  <string name=\"normal\">Proportionnelle</string>\n  <string name=\"sans\">Sans serif</string>\n  <string name=\"serif\">Serif</string>\n  <string name=\"about\">À propos</string>\n\n  <!--\n      Note for translators: You don't need to translate all these\n      translation credits below. Just the version, copyright, credit\n      for your translation and the licence. Also add your translation\n      credit here.\n  -->\n  <string name=\"version\" formatted=\"false\"><a href=\"https://github.com/billthefarmer/editor/releases/latest\">%s</a>\\n\\nCompilée le %s\\n\\nCopyright \\u00A9 2017 <a href=\"https://github.com/billthefarmer\">Bill Farmer</a>\\n\\nTraduction française par <a href=\"https://github.com/milouse\">Étienne Deparis</a>, German translation by <a href=\"https://github.com/Markus00000\">Markus Weimar</a> and <a href=\"https://github.com/AlexanderRitter02\">Alexander Ritter</a>, Italian translation by <a href=\"https://github.com/airon90\">Michael Moroni</a>, Polish translation by <a href=\"https://github.com/evo16\">Evo</a>, Greek translation by <a href=\"https://github.com/nikoss\">nikoss</a>, Spanish translation by <a href=\"https://github.com/foxneo\">Miguel Caceres</a>, Simplified Chinese translation by <a href=\"https://github.com/ludoux\">Lu Chang (ludoux)</a>, Dutch translation by <a href=\"https://github.com/Vistaus\">Heimen Stoffels (vistaus)</a>, Russian translation by <a href=\"https://github.com/bboa\">Igor Nedoboy</a>, Latvian translation by <a href=\"https://github.com/rhssk\">Rihards Skuja</a>, Icelandic translation by <a href=\"\">Sveinn í Felli</a>, Portuguese translation by <a href=\"https://github.com/Andre-Gloria\" >André Glória</a>, Chinese (Taiwan) translation by <a href=\"https://github.com/cges30901\">cges30901</a>, Turkish translation by <a href=\"https://github.com/yasarciv67\">Yaşar Çiv</a>, Brazilian Portuguese translation by <a href=\"https://github.com/aevw\">aevw</a>, Sorani Kurdish translation by <a href=\"https://github.com/rawandsaeed\">Rawand Saeed</a>, Persian (Farsi) translation by <a href=\"https://github.com/eshagh79\">Eshagh</a>\\n\\nLicence <a href=\"https://www.gnu.org/licenses/gpl.txt\">GNU GPLv3</a>\n  </string>\n\n  <string name=\"tooLarge\">Trop volumineux %s</string>\n  <string name=\"choose\">Entrez le chemin complet d\\'accès au fichier</string>\n  <string name=\"loading\">Chargement…</string>\n\n  <string name=\"modified\">\n    Vous avez des changements non enregistrés. Souhaitez-vous les enregistrer ?\n  </string>\n\n  <string name=\"changedReload\">\n    Ce fichier a changé, souhaitez-vous le recharger ?\n  </string>\n\n  <string name=\"changedOverwrite\">\n    Ce fichier a changé, souhaitez-vous l\\'écraser ?\n  </string>\n\n  <string name=\"ok\">Ok</string>\n  <string name=\"reload\">Recharger</string>\n  <string name=\"overwrite\">Écraser</string>\n  <string name=\"discard\">Abandonner</string>\n  <string name=\"cancel\">Annuler</string>\n\n</resources>\n"
  },
  {
    "path": "src/main/res/values-hu/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n\n  <string name=\"appName\">Szerkesztő</string>\n\n  <string name=\"newFile\">Új fájl</string>\n  <string name=\"openFile\">Fájl megnyitása</string>\n  <string name=\"name\">Név</string>\n  <string name=\"path\">Ösvény</string>\n  <string name=\"create\">Alkot</string>\n  <string name=\"edit\">Szerkesztés</string>\n  <string name=\"view\">Megtekintés</string>\n  <string name=\"open\">Fájl megnyitása…</string>\n  <string name=\"save\">Mentés</string>\n  <string name=\"storage\">Tároló</string>\n  <string name=\"openRecent\">Legutóbbi megnyitása</string>\n  <string name=\"clearList\">Lista törlése</string>\n  <string name=\"search\">Keresés…</string>\n  <string name=\"findAll\">Összes keresése…</string>\n  <string name=\"saveAs\">Mentés másként…</string>\n  <string name=\"detect\">Felismerés</string>\n  <string name=\"goTo\">Odamegy…</string>\n  <string name=\"print\">Nyomtat…</string>\n  <string name=\"viewMarkdown\">Markdown megtekintése…</string>\n  <string name=\"options\">Beállítások</string>\n  <string name=\"viewFile\">Fájlok megtekintése</string>\n  <string name=\"openLast\">Utolsó megnyitása</string>\n  <string name=\"autoSave\">Automatikus mentés</string>\n  <string name=\"wrap\">Szövegtördelés</string>\n  <string name=\"suggest\">Javaslatok</string>\n  <string name=\"highlight\">Szintaxiskiemelés</string>\n  <string name=\"theme\">Téma</string>\n  <string name=\"light\">Világos</string>\n  <string name=\"dark\">Sötét</string>\n  <string name=\"system\">Rendszer</string>\n  <string name=\"white\">Fehér</string>\n  <string name=\"black\">Fekete</string>\n  <string name=\"retro\">Retró</string>\n  <string name=\"size\">Szövegméret</string>\n  <string name=\"small\">Kicsi</string>\n  <string name=\"medium\">Közepes</string>\n  <string name=\"large\">Nagy</string>\n  <string name=\"typeface\">Betűkészlet</string>\n  <string name=\"mono\">Rögzített szélességű</string>\n  <string name=\"normal\">Arányos</string>\n  <string name=\"sans\">Groteszk</string>\n  <string name=\"serif\">Betűtalp</string>\n  <string name=\"about\">Névjegy</string>\n\n  <string name=\"version\" formatted=\"false\"><a href=\"https://github.com/billthefarmer/editor/releases/latest\">%s</a>\\n\\nÖsszeállítás: %s\\n\\nCopyright \\u00A9 2017–2022 <a href=\"https://github.com/billthefarmer\">Bill Farmer</a>\\n\\nMagyar fordítás: <a href=\"https://github.com/urbalazs\">Úr Balázs</a>\\n\\nLicenc: <a href=\"https://www.gnu.org/licenses/gpl.txt\">GNU GPLv3</a>\n  </string>\n\n  <string name=\"tooLarge\">Túl nagy: %s</string>\n  <string name=\"choose\">Válasszon fájlnevet</string>\n  <string name=\"loading\">Betöltés…</string>\n\n  <string name=\"modified\">\n    Mentetlen változtatásai vannak. Szeretné menteni a változtatásokat?\n  </string>\n\n  <string name=\"changedReload\">\n    Ez a fájl megváltozott, szeretné újratölteni?\n  </string>\n\n  <string name=\"changedOverwrite\">\n    Ez a fájl megváltozott, szeretné felülírni?\n  </string>\n\n  <string name=\"ok\">Rendben</string>\n  <string name=\"reload\">Újratöltés</string>\n  <string name=\"overwrite\">Felülírás</string>\n  <string name=\"discard\">Elvetés</string>\n  <string name=\"cancel\">Mégse</string>\n\n</resources>\n"
  },
  {
    "path": "src/main/res/values-is/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n\n  <string name=\"appName\">Ritill</string>\n\n  <string name=\"newFile\">Nýtt</string>\n  <string name=\"openFile\">Opna skrá</string>\n  <string name=\"name\">Nafn</string>\n  <string name=\"path\">Slóð</string>\n  <string name=\"create\">Skapa</string>\n  <string name=\"edit\">Breyta</string>\n  <string name=\"view\">Skoða</string>\n  <string name=\"open\">Opna skrá…</string>\n  <string name=\"save\">Vista</string>\n  <string name=\"storage\">Geymslurými</string>\n  <string name=\"openRecent\">Opna nýlegt</string>\n  <string name=\"clearList\">Hreinsa lista</string>\n  <string name=\"search\">Leita…</string>\n  <string name=\"findAll\">Finndu alla…</string>\n  <string name=\"saveAs\">Vista sem…</string>\n  <string name=\"detect\">Greina</string>\n  <string name=\"goTo\">Farðu til…</string>\n  <string name=\"print\">Prenta…</string>\n  <string name=\"viewMarkdown\">Skoða markdown-kóða…</string>\n  <string name=\"options\">Valkostir</string>\n  <string name=\"viewFile\">Skoða skrár</string>\n  <string name=\"openLast\">Opið síðast</string>\n  <string name=\"autoSave\">Sjálfvirk vistun</string>\n  <string name=\"wrap\">Línuskrið orða</string>\n  <string name=\"suggest\">Tillögur</string>\n  <string name=\"highlight\">Hápunktur setningafræði</string>\n  <string name=\"theme\">Þema</string>\n  <string name=\"light\">Ljóst</string>\n  <string name=\"dark\">Dökkt</string>\n  <string name=\"system\">Kerfi</string>\n  <string name=\"white\">Hvítur</string>\n  <string name=\"black\">Svartur</string>\n  <string name=\"retro\">Gamaldags</string>\n  <string name=\"size\">Stærð texta</string>\n  <string name=\"small\">Lítill</string>\n  <string name=\"medium\">Miðlungs</string>\n  <string name=\"large\">Stór</string>\n  <string name=\"typeface\">Leturgerð</string>\n  <string name=\"mono\">Jafnbreitt</string>\n  <string name=\"normal\">Hlutfallslegt</string>\n  <string name=\"sans\">Sans serif</string>\n  <string name=\"serif\">Kólumbía</string>\n  <string name=\"about\">Um hugbúnaðinn</string>\n\n  <string name=\"version\" formatted=\"false\"><a\n  href=\"https://github.com/billthefarmer/editor/releases/latest\">%s</a>\\n\\nByggt\n  %s\\n\\nHöfundarréttur \\u00A9 2017 Bill Farmer\\n\\nÍslensk þýðing: <a\n  href=\"https://github.com/sveinki\">Sveinn í\n  Felli</a>\\n\\nNotkunarleyfi <a\n  href=\"https://www.gnu.org/licenses/gpl.txt\">GNU GPLv3</a>\n  </string>\n\n  <string name=\"tooLarge\">Of stór %s</string>\n  <string name=\"choose\">Veldu skráarheiti</string>\n  <string name=\"loading\">Hleð inn…</string>\n\n  <string name=\"modified\">\n    Þú ert með óvistaðar breytingar. Viltu vista þær?\n  </string>\n\n  <string name=\"changedReload\">\n    Þessi skrá hefur breyst, viltu hlaða henni aftur inn?\n  </string>\n\n  <string name=\"changedOverwrite\">\n    Þessi skrá hefur breyst, viltu skrifa yfir hana?\n  </string>\n\n  <string name=\"ok\">Í lagi</string>\n  <string name=\"reload\">Endurhlaða</string>\n  <string name=\"overwrite\">Skrifa yfir</string>\n  <string name=\"discard\">Henda</string>\n  <string name=\"cancel\">Hætta við</string>\n\n</resources>\n"
  },
  {
    "path": "src/main/res/values-it/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n\n  <string name=\"appName\">Editor</string>\n\n  <string name=\"newFile\">Nuovo</string>\n  <string name=\"openFile\">Apri file</string>\n  <string name=\"name\">Nome</string>\n  <string name=\"path\">Sentiero</string>\n  <string name=\"create\">Creare</string>\n  <string name=\"edit\">Modificare</string>\n  <string name=\"view\">Vedere</string>\n  <string name=\"open\">Apri file…</string>\n  <string name=\"save\">Salva</string>\n  <string name=\"storage\">Archiviazione</string>\n  <string name=\"openRecent\">Apri recente</string>\n  <string name=\"clearList\">Elenco chiaro</string>\n  <string name=\"search\">Cerca…</string>\n  <string name=\"findAll\">Cerca ovunque…</string>\n  <string name=\"saveAs\">Salva come…</string>\n  <string name=\"detect\">Rileva</string>\n  <string name=\"goTo\">Vai a…</string>\n  <string name=\"print\">Stampa…</string>\n  <string name=\"viewMarkdown\">Visualizza markdown…</string>\n  <string name=\"options\">Opzioni</string>\n  <string name=\"viewFile\">Vedi files</string>\n  <string name=\"openLast\">Aperto per ultimo</string>\n  <string name=\"autoSave\">Salva automatico</string>\n  <string name=\"wrap\">A capo automatico</string>\n  <string name=\"suggest\">Suggerimenti</string>\n  <string name=\"highlight\">Evidenzia sintassi</string>\n  <string name=\"theme\">Tema</string>\n  <string name=\"light\">Chiaro</string>\n  <string name=\"white\">Bianco</string>\n  <string name=\"dark\">Scuro</string>\n  <string name=\"black\">Nero</string>\n  <string name=\"system\">Sistema</string>\n  <string name=\"retro\">Retro</string>\n  <string name=\"size\">Dimensione testo</string>\n  <string name=\"small\">Piccola</string>\n  <string name=\"medium\">Medio</string>\n  <string name=\"large\">Largo</string>\n  <string name=\"typeface\">Carattere</string>\n  <string name=\"mono\">Monospazio</string>\n  <string name=\"normal\">Proporzionale</string>\n  <string name=\"sans\">Sans serif</string>\n  <string name=\"serif\">Serif</string>\n  <string name=\"about\">Informazioni</string>\n\n  <string name=\"version\" formatted=\"false\"><a\n  href=\"https://github.com/billthefarmer/editor/releases/latest\">%s</a>\\n\\nData\n  di compilazione %s\\n\\nCopyright \\u00A9 2017 Bill\n  Farmer\\n\\nTraduzione in italiano di <a\n  href=\"https://github.com/airon90\">Michael Moroni</a>\\n\\nLicenza <a\n  href=\"https://www.gnu.org/licenses/gpl.txt\">GNU GPLv3</a>\n  </string>\n\n  <string name=\"tooLarge\">Troppo grande %s</string>\n  <string name=\"choose\">Scegli il nome del file</string>\n  <string name=\"loading\">Caricamento…</string>\n\n  <string name=\"modified\">\n    Hai delle modifiche non salvate. Vuoi salva le tue modifiche?\n  </string>\n\n  <string name=\"changedReload\">\n    Il file è cambiato. Vuoi ricaricarlo?\n  </string>\n\n  <string name=\"changedOverwrite\">\n    Il file è cambiato. Vuoi sovrascriverlo?\n  </string>\n\n  <string name=\"ok\">Ok</string>\n  <string name=\"reload\">Ricarica</string>\n  <string name=\"overwrite\">Sovrascrivi</string>\n  <string name=\"discard\">Non salvare</string>\n  <string name=\"cancel\">Annulla</string>\n\n</resources>\n"
  },
  {
    "path": "src/main/res/values-ja/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n\n  <string name=\"appName\">エディター</string>\n\n  <string name=\"newFile\">新規ファイル</string>\n  <string name=\"openFile\">ファイルを開く</string>\n  <string name=\"name\">名前</string>\n  <string name=\"path\">パス</string>\n  <string name=\"create\">創造する</string>\n  <string name=\"edit\">編集</string>\n  <string name=\"view\">閲覧</string>\n  <string name=\"open\">ファイルを開く…</string>\n  <string name=\"save\">保存</string>\n  <string name=\"storage\">ストレージ</string>\n  <string name=\"openRecent\">最近のファイル</string>\n  <string name=\"clearList\">リストをクリア</string>\n  <string name=\"search\">検索…</string>\n  <string name=\"findAll\">すべて検索</string>\n  <string name=\"saveAs\">名前をつけて保存…</string>\n  <string name=\"detect\">検出</string>\n  <string name=\"goTo\">行きます…</string>\n  <string name=\"print\">印刷…</string>\n  <string name=\"viewMarkdown\">マークダウンを閲覧…</string>\n  <string name=\"options\">オプション</string>\n  <string name=\"viewFile\">ファイル閲覧</string>\n  <string name=\"openLast\">最後に開く</string>\n  <string name=\"autoSave\">自動保存</string>\n  <string name=\"wrap\">画面端で折り返す</string>\n  <string name=\"suggest\">提案</string>\n  <string name=\"highlight\">シンタックスハイライト</string>\n  <string name=\"theme\">テーマ</string>\n  <string name=\"light\">ライト</string>\n  <string name=\"dark\">ダーク</string>\n  <string name=\"system\">制</string>\n  <string name=\"white\">白い</string>\n  <string name=\"black\">ブラック</string>\n  <string name=\"retro\">レトロ</string>\n  <string name=\"size\">文字サイズ</string>\n  <string name=\"small\">小</string>\n  <string name=\"medium\">中</string>\n  <string name=\"large\">大</string>\n  <string name=\"typeface\">書体</string>\n  <string name=\"mono\">ミニバン</string>\n  <string name=\"normal\">比例</string>\n  <string name=\"sans\">サンセリフ体</string>\n  <string name=\"serif\">セリフ</string>\n  <string name=\"about\">このアプリについて</string>\n\n  <!--\n      Note for translators: You don't need to translate all these\n      translation credits below. Just the version, copyright, credit\n      for your translation and the licence. Also add your translation\n      credit here.\n  -->\n  <string name=\"version\" formatted=\"false\"><a href=\"https://github.com/billthefarmer/editor/releases/latest\">%s</a>\\n\\nBuilt %s\\n\\nCopyright \\u00A9 2017 <a href=\"https://github.com/billthefarmer\">Bill Farmer</a>\\n\\n<a href=\"https://gitlab.com/dokutoku\">dokutoku</a>による日本語訳\\n\\nLicence <a href=\"https://www.gnu.org/licenses/gpl.txt\">GNU GPLv3</a>\n  </string>\n\n  <string name=\"tooLarge\">%sのサイズが大きすぎます</string>\n  <string name=\"choose\">ファイル名を選択してください</string>\n  <string name=\"loading\">読み込み中…</string>\n\n  <string name=\"modified\">\n    未保存の変更があります。変更を保存しますか？\n  </string>\n\n  <string name=\"changedReload\">\n   このファイルは変更されましたが、再読み込みしますか？\n  </string>\n\n  <string name=\"changedOverwrite\">\n    このファイルは変更されましたが、上書きしますか？\n  </string>\n\n  <string name=\"ok\">はい</string>\n  <string name=\"reload\">再読み込み</string>\n  <string name=\"overwrite\">上書き</string>\n  <string name=\"discard\">破棄</string>\n  <string name=\"cancel\">キャンセル</string>\n\n</resources>\n"
  },
  {
    "path": "src/main/res/values-ku-rIQ/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n\n  <string name=\"appName\">دەستکاریکەر</string>\n\n  <string name=\"newFile\">نوێ</string>\n  <string name=\"openFile\">فایل بکەرەوە</string>\n  <string name=\"name\">ناو</string>\n  <string name=\"path\">ڕێڕەو</string>\n  <string name=\"create\">پێکبهێنە</string>\n  <string name=\"edit\">دەستکاریکردن</string>\n  <string name=\"view\">پیشاندان</string>\n  <string name=\"open\">فایل بکەرەوە</string>\n  <string name=\"save\">پاشەکەوتکردن</string>\n  <string name=\"storage\">کۆگا</string>\n  <string name=\"openRecent\">کردنەوەی نوێترین</string>\n  <string name=\"clearList\">لیستەکە پاکەرەوە</string>\n  <string name=\"search\">گەڕان..،</string>\n  <string name=\"findAll\">هەموو بدۆزەرەوە</string>\n  <string name=\"saveAs\">پاشەکەوتکردن وەک</string>\n  <string name=\"detect\">دۆزینەوە</string>\n  <string name=\"goTo\">بڕۆ بۆ…</string>\n  <string name=\"print\">چاپکردن…</string>\n  <string name=\"viewMarkdown\">مارکداون پیشانبدە</string>\n  <string name=\"options\">هەڵبژاردنەکان</string>\n  <string name=\"viewFile\">فایلەکان پیشانبدە</string>\n  <string name=\"openLast\">دوایین کردنەوە</string>\n  <string name=\"autoSave\">پاشەکەتکردنی ئۆتۆماتیک</string>\n  <string name=\"wrap\">پێچانەوەی ووشە</string>\n  <string name=\"suggest\">پێشنیازەکان</string>\n  <string name=\"highlight\">بەرچاوکردنی ڕستەنووسی</string>\n  <string name=\"theme\">ڕووکار</string>\n  <string name=\"light\">کاڵ</string>\n  <string name=\"dark\">تۆخ</string>\n  <string name=\"system\">سیستەم</string>\n  <string name=\"white\">سپی</string>\n  <string name=\"black\">ڕهش</string>\n  <string name=\"retro\">ریترۆ</string>\n  <string name=\"size\">قەبارەی دەق</string>\n  <string name=\"small\">بچووک</string>\n  <string name=\"medium\">مام ناوەند</string>\n  <string name=\"large\">گەورە</string>\n  <string name=\"typeface\">تایپفەیس</string>\n  <string name=\"mono\">مۆنۆسپایس</string>\n  <string name=\"normal\">هاوڕێژە</string>\n  <string name=\"sans\">سانس سێریف</string>\n  <string name=\"serif\">سێریف</string>\n  <string name=\"about\">سەبارەت</string>\n\n  <!--\n      Note for translators: You don't need to translate all these\n      translation credits below. Just the version, copyright, credit\n      for your translation and the licence. Also add your translation\n      credit here.\n  -->\n  <string name=\"version\" formatted=\"false\"><a href=\"https://github.com/billthefarmer/editor/releases/latest\">%s</a>\\n\\nBuilt %s\\n\\nCopyright \\u00A9 2017 Bill Farmer\\n\\nSorani Kurdish translation by <a href=\"https://github.com/rawandsaeed\">Rawand Saeed</a>\\n\\nLicence <a href=\"https://www.gnu.org/licenses/gpl.txt\">GNU GPLv3</a>\n  </string>\n\n  <string name=\"tooLarge\">خڕ %s</string>\n  <string name=\"choose\">ناوی فایل هەڵبژێرە</string>\n  <string name=\"loading\">لۆدین…</string>\n\n  <string name=\"modified\">\n    گۆڕانی پاشەکەتکردنت هەیە. دەتەوێت گۆڕانەکانت پاشەکەت بکەیت؟\n  </string>\n\n  <string name=\"changedReload\">\n    فایلەکە گۆڕاوە، دەتەوێت باریبکەیتەوە؟\n  </string>\n\n  <string name=\"changedOverwrite\">\n    فایلەکە گۆڕاوە، دەتەوێث لەسەری بنووسیتەوە؟\n  </string>\n\n  <string name=\"ok\">OK</string>\n  <string name=\"reload\">بارکردنەوە</string>\n  <string name=\"overwrite\">نووسینەوەلەسەری</string>\n  <string name=\"discard\">لابردن</string>\n  <string name=\"cancel\">هەڵوەشاندنەوە</string>\n\n</resources>\n"
  },
  {
    "path": "src/main/res/values-lv/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n\n  <string name=\"appName\">Redaktors</string>\n\n  <string name=\"newFile\">Jauns</string>\n  <string name=\"openFile\">Atvērt failu</string>\n  <string name=\"name\">Vārds</string>\n  <string name=\"path\">Ceļu</string>\n  <string name=\"create\">Radīt</string>\n  <string name=\"edit\">Rediģēt</string>\n  <string name=\"view\">Skatīt</string>\n  <string name=\"open\">Atvērt failu…</string>\n  <string name=\"save\">Saglabāt</string>\n  <string name=\"storage\">Krātuve</string>\n  <string name=\"openRecent\">Atvērt neseno</string>\n  <string name=\"clearList\">Notīrīt sarakstu</string>\n  <string name=\"search\">Meklēt…</string>\n  <string name=\"findAll\">Atrodi visu…</string>\n  <string name=\"saveAs\">Saglabāt kā…</string>\n  <string name=\"detect\">Atklāt</string>\n  <string name=\"goTo\">Doties uz…</string>\n  <string name=\"print\">Drukāt…</string>\n  <string name=\"viewMarkdown\">Skatīt markdown…</string>\n  <string name=\"options\">Opcijas</string>\n  <string name=\"viewFile\">Skatīt failus</string>\n  <string name=\"openLast\">Atvērt pēdējo</string>\n  <string name=\"autoSave\">Automātiska saglabāšana</string>\n  <string name=\"wrap\">Vārdu aplaušana</string>\n  <string name=\"suggest\">Ieteikumi</string>\n  <string name=\"highlight\">Izcelt sintaksi</string>\n  <string name=\"theme\">Motīvs</string>\n  <string name=\"light\">Gaišs</string>\n  <string name=\"dark\">Tumšs</string>\n  <string name=\"system\">Sistēma</string>\n  <string name=\"white\">Balts</string>\n  <string name=\"black\">Melns</string>\n  <string name=\"retro\">Retro</string>\n  <string name=\"size\">Teksta izmērs</string>\n  <string name=\"small\">Mazs</string>\n  <string name=\"medium\">Vidējs</string>\n  <string name=\"large\">Liels</string>\n  <string name=\"typeface\">Burtveidols</string>\n  <string name=\"mono\">Vienplatuma</string>\n  <string name=\"normal\">Proporcionāls</string>\n  <string name=\"sans\">Sans serifs</string>\n  <string name=\"serif\">Serif</string>\n  <string name=\"about\">Par</string>\n\n  <string name=\"version\" formatted=\"false\"><a\n  href=\"https://github.com/billthefarmer/editor/releases/latest\">%s</a>\\n\\nBūvēts\n  %s\\n\\nAutortiesības \\u00A9 2017 Bill Farmer\\n\\nNo latviešu valodas\n  tulkojis <a href=\"https://github.com/rhssk\">Rihards Skuja\n  </a>\\n\\nLicence <a href=\"https://www.gnu.org/licenses/gpl.txt\">GNU\n  GPLv3</a>\n  </string>\n\n  <string name=\"tooLarge\">Pārāk liels %s</string>\n  <string name=\"choose\">Izvēlies faila nosaukumu</string>\n  <string name=\"loading\">Atver…</string>\n\n  <string name=\"modified\">\n    Tev ir nesaglabātas izmaiņas. Vai vēlies tās saglabāt?\n  </string>\n\n  <string name=\"changedReload\">\n    Šis fails ir izmainījies. Vai vēlies to pārlādēt?\n  </string>\n\n  <string name=\"changedOverwrite\">\n    Šis fails ir izmainījies. Vai vēlies to pārrakstīt?\n  </string>\n\n  <string name=\"ok\">Labi</string>\n  <string name=\"reload\">Pārlādēt</string>\n  <string name=\"overwrite\">Pārrakstīt</string>\n  <string name=\"discard\">Atmest izmaiņas</string>\n  <string name=\"cancel\">Atcelt</string>\n\n</resources>\n"
  },
  {
    "path": "src/main/res/values-nl/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n\n  <string name=\"appName\">Tekstbewerker</string>\n\n  <string name=\"newFile\">Nieuw</string>\n  <string name=\"openFile\">Bestand openen</string>\n  <string name=\"name\">Naam</string>\n  <string name=\"path\">Pad</string>\n  <string name=\"create\">Scheppen</string>\n  <string name=\"edit\">Bewerken</string>\n  <string name=\"view\">Tonen</string>\n  <string name=\"open\">Bestand openen…</string>\n  <string name=\"save\">Opslaan</string>\n  <string name=\"storage\">Opslagruimte</string>\n  <string name=\"openRecent\">Recent bestand openen</string>\n  <string name=\"clearList\">Lijst wissen</string>\n  <string name=\"search\">Zoeken…</string>\n  <string name=\"findAll\">Alles zoeken…</string>\n  <string name=\"detect\">Detecteren</string>\n  <string name=\"goTo\">Ga naar…</string>\n  <string name=\"saveAs\">Opslaan als…</string>\n  <string name=\"print\">Afdrukken…</string>\n  <string name=\"viewMarkdown\">Markdown tonen…</string>\n  <string name=\"options\">Opties</string>\n  <string name=\"viewFile\">Bestanden tonen</string>\n  <string name=\"openLast\">Laatste openen</string>\n  <string name=\"autoSave\">Automatisch opslaan</string>\n  <string name=\"wrap\">Tekstomloop</string>\n  <string name=\"suggest\">Suggesties</string>\n  <string name=\"highlight\">Syntaxis markeren</string>\n  <string name=\"theme\">Thema</string>\n  <string name=\"light\">Licht</string>\n  <string name=\"dark\">Donker</string>\n  <string name=\"system\">Systeem</string>\n  <string name=\"white\">Wit</string>\n  <string name=\"black\">Zwart</string>\n  <string name=\"retro\">Retro</string>\n  <string name=\"size\">Lettergrootte</string>\n  <string name=\"small\">Klein</string>\n  <string name=\"medium\">Normaal</string>\n  <string name=\"large\">Groot</string>\n  <string name=\"typeface\">Lettertype</string>\n  <string name=\"mono\">Vaste breedte</string>\n  <string name=\"normal\">Proportioneel</string>\n  <string name=\"sans\">Schreefloos</string>\n  <string name=\"serif\">Schreef</string>\n  <string name=\"about\">Over</string>\n\n  <string name=\"version\" formatted=\"false\"><a\n  href=\"https://github.com/billthefarmer/editor/releases/latest\">%s</a>\\n\\nGebouwd\n  op %s\\n\\nCopyright \\u00A9 2017 Bill Farmer\\n\\nNederlandse vertaling\n  door <a href=\"https://github.com/Vistaus\">Heimen Stoffels\n  (vistaus)</a>\\n\\nLicentie <a\n  href=\"https://www.gnu.org/licenses/gpl.txt\">GNU GPLv3</a>\n  </string>\n\n  <string name=\"tooLarge\">Te groot %s</string>\n  <string name=\"choose\">Kies een bestandsnaam</string>\n  <string name=\"loading\">Bezig met laden…</string>\n\n  <string name=\"modified\">\n    Je hebt niet-opgeslagen wijzigingen. Wil je deze opslaan?\n  </string>\n\n  <string name=\"changedReload\">\n    Het bestand is gewijzigd; wil je het herladen?\n  </string>\n\n  <string name=\"changedOverwrite\">\n    Het bestand is gewijzigd; wil je het overschrijven?\n  </string>\n\n  <string name=\"ok\">Oké</string>\n  <string name=\"reload\">Herladen</string>\n  <string name=\"overwrite\">Overschrijven</string>\n  <string name=\"discard\">Verwerpen</string>\n  <string name=\"cancel\">Annuleren</string>\n\n</resources>\n"
  },
  {
    "path": "src/main/res/values-pl/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n\n  <string name=\"appName\">Editor</string>\n\n  <string name=\"newFile\">Nowy</string>\n  <string name=\"openFile\">Otwórz plik</string>\n  <string name=\"name\">Nazwa</string>\n  <string name=\"path\">Ścieżka</string>\n  <string name=\"create\">Tworzyć</string>\n  <string name=\"edit\">Edytuj</string>\n  <string name=\"view\">Podgląd</string>\n  <string name=\"open\">Otwórz plik…</string>\n  <string name=\"save\">Zapisz</string>\n  <string name=\"storage\">Pamięć wewnętrzna</string>\n  <string name=\"openRecent\">Otwórz poprzedni</string>\n  <string name=\"clearList\">Czysta lista</string>\n  <string name=\"search\">Szukaj…</string>\n  <string name=\"findAll\">Znajdź wszystkie…</string>\n  <string name=\"saveAs\">Zapisz jako…</string>\n  <string name=\"detect\">Wykryć</string>\n  <string name=\"goTo\">Przejdź do…</string>\n  <string name=\"print\">Wydrukować…</string>\n  <string name=\"viewMarkdown\">Wyświetl markdown…</string>\n  <string name=\"options\">Opcje</string>\n  <string name=\"viewFile\">Pokaż pliki</string>\n  <string name=\"openLast\">Otwarte jako ostatnie</string>\n  <string name=\"autoSave\">Autozapis</string>\n  <string name=\"wrap\">Zawijanie słów</string>\n  <string name=\"suggest\">Sugestie</string>\n  <string name=\"highlight\">Podświetl składnię</string>\n  <string name=\"theme\">Motyw</string>\n  <string name=\"light\">Jasny</string>\n  <string name=\"dark\">Ciemny</string>\n  <string name=\"system\">System</string>\n  <string name=\"white\">Biały</string>\n  <string name=\"black\">Czarny</string>\n  <string name=\"retro\">Retro</string>\n  <string name=\"size\">Rozmiar czcionki</string>\n  <string name=\"small\">Mały</string>\n  <string name=\"medium\">Średni</string>\n  <string name=\"large\">Duży</string>\n  <string name=\"typeface\">Czcionka</string>\n  <string name=\"mono\">Monospace</string>\n  <string name=\"normal\">Proporcjonalny</string>\n  <string name=\"sans\">Bezszeryfowy</string>\n  <string name=\"serif\">Szeryf</string>\n  <string name=\"about\">O programie</string>\n\n  <string name=\"version\" formatted=\"false\"><a\n  href=\"https://github.com/billthefarmer/editor/releases/latest\">%s</a>\\n\\nData\n  kompilacji %s\\n\\nCopyright \\u00A9 2017 Bill Farmer\\n\\nPolskie\n  tłumaczenie <a href=\"https://github.com/evo16\">Evo</a>\\n\\nLicencja\n  <a href=\"https://www.gnu.org/licenses/gpl.txt\">GNU GPLv3</a>\n  </string>\n\n  <string name=\"tooLarge\">Za duży %s</string>\n  <string name=\"choose\">Wybierz nazwę pliku</string>\n  <string name=\"loading\">Ładowanie…</string>\n\n  <string name=\"modified\">\n    Masz niezapisane zmiany. Czy chcesz je zapisać?\n  </string>\n\n  <string name=\"changedReload\">\n    Plik uległ zmianie, czy chcesz go wczytać ponownie?\n  </string>\n\n  <string name=\"changedOverwrite\">\n    Plik uległ zmianie, czy chcesz go nadpisać?\n  </string>\n\n  <string name=\"ok\">OK</string>\n  <string name=\"reload\">Wczytaj ponownie</string>\n  <string name=\"overwrite\">Nadpisz</string>\n  <string name=\"discard\">Porzuć</string>\n  <string name=\"cancel\">Anuluj</string>\n\n</resources>\n"
  },
  {
    "path": "src/main/res/values-pt/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n\n  <string name=\"appName\">Editor</string>\n\n  <string name=\"newFile\">Novo</string>\n  <string name=\"openFile\">Abrir ficheiro</string>\n  <string name=\"name\">Designação</string>\n  <string name=\"path\">Caminho</string>\n  <string name=\"create\">Criar</string>\n  <string name=\"edit\">Editar</string>\n  <string name=\"view\">Ver</string>\n  <string name=\"open\">Abrir ficheiro…</string>\n  <string name=\"save\">Guardar</string>\n  <string name=\"storage\">Armazenamento</string>\n  <string name=\"openRecent\">Abrir recente</string>\n  <string name=\"clearList\">Limpar lista</string>\n  <string name=\"search\">Pesquisar…</string>\n  <string name=\"findAll\">Pesquisar tudo…</string>\n  <string name=\"saveAs\">Guardar como…</string>\n  <string name=\"detect\">Detetar</string>\n  <string name=\"goTo\">Ir para…</string>\n  <string name=\"print\">Impressão…</string>\n  <string name=\"viewMarkdown\">Ver markdown…</string>\n  <string name=\"options\">Opções</string>\n  <string name=\"viewFile\">Ver ficheiros</string>\n  <string name=\"openLast\">Abrir por último</string>\n  <string name=\"autoSave\">Guardar automático</string>\n  <string name=\"wrap\">Quebras de linha</string>\n  <string name=\"suggest\">Mostrar sugestões</string>\n  <string name=\"highlight\">Destacar sintaxe</string>\n  <string name=\"theme\">Tema</string>\n  <string name=\"light\">Claro</string>\n  <string name=\"dark\">Escuro</string>\n  <string name=\"white\">Branco</string>\n  <string name=\"black\">Preto</string>\n  <string name=\"system\">Sistema</string>\n  <string name=\"retro\">Retro</string>\n  <string name=\"size\">Tamanho das letras</string>\n  <string name=\"small\">Pequeno</string>\n  <string name=\"medium\">Médio</string>\n  <string name=\"large\">Grande</string>\n  <string name=\"typeface\">Espaçamento</string>\n  <string name=\"mono\">Monoespaçado</string>\n  <string name=\"normal\">Proporcional</string>\n  <string name=\"sans\">Sem serifa</string>\n  <string name=\"serif\">Serif</string>\n  <string name=\"about\">Sobre</string>\n\n  <!--\n      Note for translators: You don't need to translate all these\n      translation credits below. Just the version, copyright, credit\n      for your translation and the licence. Also add your translation\n      credit here.\n  -->\n  <string name=\"version\" formatted=\"false\"><a\n  href=\"https://github.com/billthefarmer/editor/releases/latest\">%s</a>\\n\\nCompilado\n  a %s\\n\\nDireitos de autor \\u00A9 2017 <a href=\"https://github.com/billthefarmer\">Bill Farmer</a>\\n\\nTradução Portuguesa por\n  <a href=\"https://github.com/Andre-Gloria\" >André\n  Glória</a> e <a href=\"https://github.com/laralem\">laralem</a>\\n\\nLicença <a href=\"https://www.gnu.org/licenses/gpl.txt\"\n  >GNU GPLv3</a></string>\n  \n  <string name=\"tooLarge\">Demasiado grande %s</string>\n  <string name=\"choose\">Escolha um nome de ficheiro</string>\n  <string name=\"loading\">A carregar…</string>\n\n  <string name=\"modified\">\n    Tem alterações por guardar. Quer guardá-las?\n  </string>\n\n  <string name=\"changedReload\">\n    Este ficheiro foi alterado, quer tornar a abri-lo?\n  </string>\n\n  <string name=\"changedOverwrite\">\n    Este ficheiro foi alterado, quer substituí-lo (perderá as alterações)?\n  </string>\n\n  <string name=\"ok\">OK</string>\n  <string name=\"reload\">Reabrir</string>\n  <string name=\"overwrite\">Substituir</string>\n  <string name=\"discard\">Descartar</string>\n  <string name=\"cancel\">Cancelar</string>\n\n</resources>\n"
  },
  {
    "path": "src/main/res/values-pt-rBR/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n\n  <string name=\"appName\">Editor</string>\n\n  <string name=\"newFile\">Novo</string>\n  <string name=\"openFile\">Abrir arquivo</string>\n  <string name=\"name\">Nome</string>\n  <string name=\"path\">Caminho</string>\n  <string name=\"create\">Criar</string>\n  <string name=\"edit\">Editar</string>\n  <string name=\"view\">Ver</string>\n  <string name=\"open\">Abrir arquivo…</string>\n  <string name=\"save\">Salvar</string>\n  <string name=\"storage\">Armazenamento</string>\n  <string name=\"openRecent\">Abrir recente</string>\n  <string name=\"clearList\">Limpar lista</string>\n  <string name=\"search\">Procurar…</string>\n  <string name=\"findAll\">Encontrar todos…</string>\n  <string name=\"saveAs\">Salvar como…</string>\n  <string name=\"detect\">Detectar</string>\n  <string name=\"goTo\">Ir para…</string>\n  <string name=\"print\">Impressão…</string>\n  <string name=\"viewMarkdown\">Ver markdown…</string>\n  <string name=\"options\">Opções</string>\n  <string name=\"viewFile\">Ver arquivos</string>\n  <string name=\"openLast\">Abrir por último</string>\n  <string name=\"autoSave\">Auto salvar</string>\n  <string name=\"wrap\">Quebra as linhas</string>\n  <string name=\"suggest\">Sugestões</string>\n  <string name=\"highlight\">Destacar a sintaxe</string>\n  <string name=\"theme\">Tema</string>\n  <string name=\"light\">Claro</string>\n  <string name=\"white\">Branco</string>\n  <string name=\"dark\">Escuro</string>\n  <string name=\"system\">Sistema</string>\n  <string name=\"retro\">Retrô</string>\n  <string name=\"size\">Tamanho do texto</string>\n  <string name=\"small\">Pequeno</string>\n  <string name=\"medium\">Médio</string>\n  <string name=\"large\">Grande</string>\n  <string name=\"typeface\">Tipo da fonte</string>\n  <string name=\"mono\">Monospace</string>\n  <string name=\"normal\">Proporcional</string>\n  <string name=\"sans\">Sem serifa</string>\n  <string name=\"serif\">Serif</string>\n  <string name=\"about\">Sobre</string>\n\n  <!--\n      Note for translators: You don't need to translate all these\n      translation credits below. Just the version, copyright, credit for\n      your translation and the licence. Also add your translation credit\n      here.\n  -->\n\n  <string name=\"version\" formatted=\"false\"><a href=\"https://github.com/billthefarmer/editor/releases/latest\">%s</a>\\n\\nCompilado %s\\n\\nCopyright \\u00A9 2017 <a href=\"https://github.com/billthefarmer\">Bill Farmer</a>\\n\\nTradução para português brasileiro por <a href=\"https://github.com/aevw\">aevw</a>\\n\\nLicença <a href=\"https://www.gnu.org/licenses/gpl.txt\">GNU GPLv3</a>\n  </string>\n\n  <string name=\"tooLarge\">Muito grande %s</string>\n  <string name=\"choose\">Digite um nome de arquivo</string>\n  <string name=\"loading\">Abrindo…</string>\n\n  <string name=\"modified\">\n    Tem alterações não salvas. Você quer salvar?\n  </string>\n\n  <string name=\"changedReload\">\n    Este arquivo foi modificado, quer atualizar?\n  </string>\n\n  <string name=\"changedOverwrite\">\n    Este arquivo foi modificado, você quer substituí-lo (perderá alterações)?\n  </string>\n\n  <string name=\"ok\">OK</string>\n  <string name=\"reload\">Recarregar</string>\n  <string name=\"overwrite\">Substituir</string>\n  <string name=\"discard\">Descartar</string>\n  <string name=\"cancel\">Cancelar</string>\n\n</resources>\n"
  },
  {
    "path": "src/main/res/values-ru/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n\n  <string name=\"appName\">Редактор</string>\n\n  <string name=\"search\">Поиск…</string>\n  <string name=\"openFile\">Открыть файл</string>\n  <string name=\"name\">Имя</string>\n  <string name=\"path\">Путь</string>\n  <string name=\"create\">Создавать</string>\n  <string name=\"findAll\">Найти все…</string>\n  <string name=\"newFile\">Новый</string>\n  <string name=\"edit\">Редактор</string>\n  <string name=\"view\">Просмотр</string>\n  <string name=\"open\">Открыть файл…</string>\n  <string name=\"save\">Сохранить</string>\n  <string name=\"storage\">Хранилище</string>\n  <string name=\"openRecent\">Недавние</string>\n  <string name=\"clearList\">Очистить список</string>\n  <string name=\"saveAs\">Сохранить как…</string>\n  <string name=\"detect\">Обнаруживать</string>\n  <string name=\"goTo\">Перейти к…</string>\n  <string name=\"print\">Печатать…</string>\n  <string name=\"viewMarkdown\">Просмотр Markdown…</string>\n  <string name=\"options\">Параметры</string>\n  <string name=\"viewFile\">Просмотр файлов</string>\n  <string name=\"openLast\">Открыт последним</string>\n  <string name=\"autoSave\">Автосохранение</string>\n  <string name=\"wrap\">Перенос строк</string>\n  <string name=\"suggest\">Варианты слов</string>\n  <string name=\"highlight\">Выделить синтаксис</string>\n  <string name=\"theme\">Тема</string>\n  <string name=\"light\">Светлая</string>\n  <string name=\"dark\">Тёмная</string>\n  <string name=\"white\">Белая</string>\n  <string name=\"black\">Чёрная</string>\n  <string name=\"system\">Системная</string>\n  <string name=\"retro\">Ретро</string>\n  <string name=\"size\">Размер шрифта</string>\n  <string name=\"small\">Малый</string>\n  <string name=\"medium\">Средний</string>\n  <string name=\"large\">Крупный</string>\n  <string name=\"typeface\">Шрифт</string>\n  <string name=\"mono\">Моноширинный</string>\n  <string name=\"normal\">Пропорциональный</string>\n  <string name=\"sans\">Без засечек</string>\n  <string name=\"serif\">С засечками</string>\n  <string name=\"about\">О приложении</string>\n\n  <string name=\"version\" formatted=\"false\"><a\n  href=\"https://github.com/billthefarmer/editor/releases/latest\">%s</a>\\n\\nСборка\n  %s\\nРазработка \\u00A9 2017 Bill Farmer\\n\\nРусский перевод \\u00A9 <a\n  href=\"https://github.com/bboa\">Igor Nedoboy</a>\\n\\nЛицензия <a\n  href=\"https://www.gnu.org/licenses/gpl.txt\">GNU GPLv3</a>\n  </string>\n\n  <string name=\"tooLarge\">Слишком большой %s</string>\n  <string name=\"choose\">Выберите имя файла</string>\n  <string name=\"loading\">Чтение…</string>\n\n  <string name=\"modified\">\n    Сохранить изменения?\n  </string>\n\n  <string name=\"changedReload\">\n    Файл изменился, перечитать?\n  </string>\n\n  <string name=\"changedOverwrite\">\n    Файл изменился, перезаписать?\n  </string>\n\n  <string name=\"ok\">ОК</string>\n  <string name=\"reload\">Перечитать</string>\n  <string name=\"overwrite\">Перезаписать</string>\n  <string name=\"discard\">Не сохранять</string>\n  <string name=\"cancel\">Отмена</string>\n\n</resources>\n"
  },
  {
    "path": "src/main/res/values-tr/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n\n  <string name=\"appName\">Düzenleyici</string>\n\n  <string name=\"newFile\">Yeni</string>\n  <string name=\"openFile\">Dosya aç</string>\n  <string name=\"name\">Ad</string>\n  <string name=\"path\">Yol</string>\n  <string name=\"create\">Yaratmak</string>\n  <string name=\"edit\">Düzenle</string>\n  <string name=\"view\">Görünüm</string>\n  <string name=\"open\">Dosya aç…</string>\n  <string name=\"save\">Kaydet</string>\n  <string name=\"storage\">Depolama</string>\n  <string name=\"openRecent\">Son kullanılanı aç</string>\n  <string name=\"clearList\">Listeyi temizle</string>\n  <string name=\"search\">Ara…</string>\n  <string name=\"findAll\">Hepsini bul…</string>\n  <string name=\"saveAs\">Farklı kaydet…</string>\n  <string name=\"detect\">Algılamak</string>\n  <string name=\"goTo\">Git…</string>\n  <string name=\"print\">Yazdır…</string>\n  <string name=\"viewMarkdown\">Markdown görünümü…</string>\n  <string name=\"options\">Seçenekler</string>\n  <string name=\"viewFile\">Dosyaları görüntüle</string>\n  <string name=\"openLast\">En son aç</string>\n  <string name=\"autoSave\">Otomatik kaydet</string>\n  <string name=\"wrap\">Sözcük kaydırma</string>\n  <string name=\"suggest\">Öneriler</string>\n  <string name=\"highlight\">Sözdizimini vurgula</string>\n  <string name=\"theme\">Tema</string>\n  <string name=\"light\">Açık</string>\n  <string name=\"dark\">Koyu</string>\n  <string name=\"white\">Beyaz</string>\n  <string name=\"black\">Siyah</string>\n  <string name=\"system\">Sistem</string>\n  <string name=\"retro\">Nostaljik</string>\n  <string name=\"size\">Metin boyutu</string>\n  <string name=\"small\">Küçük</string>\n  <string name=\"medium\">Orta</string>\n  <string name=\"large\">Büyük</string>\n  <string name=\"typeface\">Harf karakteri</string>\n  <string name=\"mono\">Eş aralıklı</string>\n  <string name=\"normal\">Orantılı</string>\n  <string name=\"sans\">Sans serif</string>\n  <string name=\"serif\">Serif</string>\n  <string name=\"about\">Hakkında</string>\n\n  <!--\n      Note for translators: You don't need to translate all these\n      translation credits below. Just the version, copyright, credit\n      for your translation and the licence. Also add your translation\n      credit here.\n  -->\n\n  <string name=\"version\" formatted=\"false\"><a\n  href=\"https://github.com/billthefarmer/editor/releases/latest\">%s</a>\\n\\n%s\n  tarihinde oluşturuldu\\n\\nTelif Hakkı \\u00A9 2017 Bill\n  Farmer\\n\\nTürkçe çeviri <a\n  href=\"https://github.com/yasarciv67\">Yaşar Çiv</a> tarafından\n  yapıldı\\n\\nLisans <a href=\"https://www.gnu.org/licenses/gpl.txt\">GNU\n  GPLv3</a>\n  </string>\n\n  <string name=\"tooLarge\">Çok büyük %s</string>\n  <string name=\"choose\">Bir dosya adı seçin</string>\n  <string name=\"loading\">Yükleniyor…</string>\n\n  <string name=\"modified\">Kaydedilmemiş değişiklikleriniz mevcut.  Değişikliklerinizi kaydetmek ister misiniz?</string>\n\n  <string name=\"changedReload\">Bu dosya değişti, yeniden yüklemek ister misiniz?</string>\n\n  <string name=\"changedOverwrite\">Bu dosya değişti, üzerine yazmak istiyor musunuz?</string>\n\n  <string name=\"ok\">Tamam</string>\n  <string name=\"reload\">Yeniden yükle</string>\n  <string name=\"overwrite\">Üzerine yaz</string>\n  <string name=\"discard\">Gözardı et</string>\n  <string name=\"cancel\">İptal et</string>\n\n</resources>\n"
  },
  {
    "path": "src/main/res/values-uk/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n\n  <string name=\"appName\">Редактор</string>\n\n  <string name=\"newFile\">Новий файл</string>\n  <string name=\"openFile\">Відкрити файл</string>\n  <string name=\"name\">Назва</string>\n  <string name=\"path\">Шлях</string>\n  <string name=\"create\">Творити</string>\n  <string name=\"edit\">Змінити</string>\n  <string name=\"view\">Переглянути</string>\n  <string name=\"open\">Відкрити файл…</string>\n  <string name=\"save\">Зберегти</string>\n  <string name=\"storage\">Сховище</string>\n  <string name=\"openRecent\">Відкрити останні</string>\n  <string name=\"clearList\">Очистити список</string>\n  <string name=\"search\">Пошук…</string>\n  <string name=\"findAll\">Шукати все…</string>\n  <string name=\"saveAs\">Зберегти як…</string>\n  <string name=\"detect\">Виявити</string>\n  <string name=\"goTo\">Перейти до…</string>\n  <string name=\"print\">Друк…</string>\n  <string name=\"viewMarkdown\">Переглянути markdown…</string>\n  <string name=\"options\">Параметри</string>\n  <string name=\"viewFile\">Переглянути файли</string>\n  <string name=\"openLast\">Відкрити останню</string>\n  <string name=\"autoSave\">Автозбереження</string>\n  <string name=\"wrap\">Перенесення слів</string>\n  <string name=\"suggest\">Пропозиції</string>\n  <string name=\"highlight\">Підсвітка синтаксису</string>\n  <string name=\"theme\">Тема</string>\n  <string name=\"light\">Світла</string>\n  <string name=\"dark\">Темна</string>\n  <string name=\"system\">Система</string>\n  <string name=\"white\">Біла</string>\n  <string name=\"black\">Чорна</string>\n  <string name=\"retro\">Ретро</string>\n  <string name=\"size\">Розмір шрифту</string>\n  <string name=\"small\">Малий</string>\n  <string name=\"medium\">Середній</string>\n  <string name=\"large\">Великий</string>\n  <string name=\"typeface\">Шрифт</string>\n  <string name=\"mono\">Моноширний</string>\n  <string name=\"normal\">Пропорційний</string>\n  <string name=\"sans\">Без засічок</string>\n  <string name=\"serif\">Із засічками</string>\n  <string name=\"about\">Про застосунок</string>\n\n  <!--\n      Note for translators: You don't need to translate all these\n      translation credits below. Just the version, copyright, credit\n      for your translation and the licence. Also add your translation\n      credit here.\n  -->\n  <string name=\"version\" formatted=\"false\"><a href=\"https://github.com/billthefarmer/editor/releases/latest\">%s</a>\\n\\nЗбірка %s\\n\\nАвторські права \\u00A9 2017 <a href=\"https://github.com/billthefarmer\">Bill Farmer</a>\\n\\nFrench translation by <a href=\"https://github.com/milouse\">Étienne Deparis</a>, German translation by <a href=\"https://github.com/Markus00000\">Markus Weimar</a> and <a href=\"https://github.com/AlexanderRitter02\">Alexander Ritter</a>, Italian translation by <a href=\"https://github.com/airon90\">Michael Moroni</a>, Polish translation by <a href=\"https://github.com/evo16\">Evo</a>, Greek translation by <a href=\"https://github.com/nikoss\">nikoss</a>, Spanish translation by <a href=\"https://github.com/foxneo\">Miguel Caceres</a>, Simplified Chinese translation by <a href=\"https://github.com/ludoux\">Lu Chang (ludoux)</a>, Dutch translation by <a href=\"https://github.com/Vistaus\">Heimen Stoffels (vistaus)</a>, Russian translation by <a href=\"https://github.com/bboa\">Igor Nedoboy</a>, Latvian translation by <a href=\"https://github.com/rhssk\">Rihards Skuja</a>, Icelandic translation by <a href=\"\">Sveinn í Felli</a>, Portuguese translation by <a href=\"https://github.com/Andre-Gloria\" >André Glória</a>, Chinese (Taiwan) translation by <a href=\"https://github.com/cges30901\">cges30901</a>, Turkish translation by <a href=\"https://github.com/yasarciv67\">Yaşar Çiv</a>, Brazilian Portuguese translation by <a href=\"https://github.com/aevw\">aevw</a>, Sorani Kurdish translation by <a href=\"https://github.com/rawandsaeed\">Rawand Saeed</a>, Persian (Farsi) translation by <a href=\"https://github.com/eshagh79\">Eshagh</a>, Hungarian translation by <a href=\"https://github.com/urbalazs\">Balázs Úr</a>, Japanese translation by <a href=\"https://gitlab.com/dokutoku\">dokutoku</a>, Українською переклав <a href=\"https://github.com/andmizyk\">Andrij Mizyk</a>\\n\\nЛіцензія <a href=\"https://www.gnu.org/licenses/gpl.txt\">GNU GPLv3</a>\n  </string>\n\n  <string name=\"tooLarge\">Задовга %s</string>\n  <string name=\"choose\">Оберіть назву файлу</string>\n  <string name=\"loading\">Завантаження…</string>\n\n  <string name=\"modified\">\n    У Вас не збережені зміни. Бажаєте зберегти їх?\n  </string>\n\n  <string name=\"changedReload\">\n    Цей файл змінено, бажаєте перезавантажити його?\n  </string>\n\n  <string name=\"changedOverwrite\">\n    Цей файл змінено, бажаєте перезаписати його?\n  </string>\n\n  <string name=\"ok\">Гаразд</string>\n  <string name=\"reload\">Перезавантажити</string>\n  <string name=\"overwrite\">Перезаписати</string>\n  <string name=\"discard\">Відхилити</string>\n  <string name=\"cancel\">Скасувати</string>\n\n</resources>\n"
  },
  {
    "path": "src/main/res/values-zh-rCN/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n\n  <string name=\"appName\">编辑器</string>\n\n  <string name=\"newFile\">新</string>\n  <string name=\"openFile\">打开文件</string>\n  <string name=\"name\">名字</string>\n  <string name=\"path\">路径</string>\n  <string name=\"create\">创造</string>\n  <string name=\"edit\">编辑</string>\n  <string name=\"view\">查看</string>\n  <string name=\"open\">打开文件…</string>\n  <string name=\"save\">保存</string>\n  <string name=\"storage\">存储空间</string>\n  <string name=\"openRecent\">打开最近文本</string>\n  <string name=\"clearList\">清除列表</string>\n  <string name=\"search\">查找…</string>\n  <string name=\"findAll\">全局搜索…</string>\n  <string name=\"saveAs\">保存为…</string>\n  <string name=\"detect\">检测</string>\n  <string name=\"goTo\">转到…</string>\n  <string name=\"print\">打印…</string>\n  <string name=\"viewMarkdown\">查看 Markdown…</string>\n  <string name=\"options\">选项</string>\n  <string name=\"viewFile\">查看文件</string>\n  <string name=\"openLast\">最后打开</string>\n  <string name=\"autoSave\">自动保存</string>\n  <string name=\"wrap\">自动换行</string>\n  <string name=\"suggest\">建议</string>\n  <string name=\"highlight\">突出显示语法</string>\n  <string name=\"theme\">主题</string>\n  <string name=\"light\">亮</string>\n  <string name=\"dark\">暗</string>\n  <string name=\"system\">系统</string>\n  <string name=\"white\">白</string>\n  <string name=\"black\">黑色的</string>\n  <string name=\"retro\">复古</string>\n  <string name=\"size\">文本大小</string>\n  <string name=\"small\">小</string>\n  <string name=\"medium\">中</string>\n  <string name=\"large\">大</string>\n  <string name=\"typeface\">字体</string>\n  <string name=\"mono\">等宽</string>\n  <string name=\"normal\">变宽</string>\n  <string name=\"sans\">无衬线</string>\n  <string name=\"serif\">衬线</string>\n  <string name=\"about\">关于</string>\n\n  <string name=\"version\" formatted=\"false\"><a\n  href=\"https://github.com/billthefarmer/editor/releases/latest\">%s</a>\\n\\n\n  编译时间 %s\\n\\n版权 \\u00A9 2017 Bill Farmer\\n\\n中文（简体）译者<a\n  href=\"https://github.com/ludoux\">Lu Chang (ludoux)</a>\\n\\n开源协议<a\n  href=\"https://www.gnu.org/licenses/gpl.txt\">GNU GPLv3</a>\n  </string>\n\n  <string name=\"tooLarge\">太大了 %s</string>\n  <string name=\"choose\">选择一个文件</string>\n  <string name=\"loading\">加载中…</string>\n\n  <string name=\"modified\">\n    你有未保存的更改。你想保存这些更改吗？\n  </string>\n\n  <string name=\"changedReload\">\n    文件已被更改，你想重载它吗？\n  </string>\n\n  <string name=\"changedOverwrite\">\n    文件已被更改，你想覆写它吗？\n  </string>\n\n  <string name=\"ok\">OK</string>\n  <string name=\"reload\">重载</string>\n  <string name=\"overwrite\">覆写</string>\n  <string name=\"discard\">放弃更改</string>\n  <string name=\"cancel\">取消</string>\n\n</resources>\n"
  },
  {
    "path": "src/main/res/values-zh-rTW/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n\n  <string name=\"appName\">編輯器</string>\n\n  <string name=\"newFile\">新增</string>\n  <string name=\"openFile\">開啟檔案</string>\n  <string name=\"name\">名字</string>\n  <string name=\"path\">路径</string>\n  <string name=\"create\">创造</string>\n  <string name=\"edit\">編輯</string>\n  <string name=\"view\">檢視</string>\n  <string name=\"open\">開啟檔案…</string>\n  <string name=\"save\">儲存</string>\n  <string name=\"storage\">儲存空間</string>\n  <string name=\"openRecent\">最近開啟</string>\n  <string name=\"clearList\">清除清單</string>\n  <string name=\"search\">搜尋…</string>\n  <string name=\"findAll\">尋找全部…</string>\n  <string name=\"saveAs\">儲存為…</string>\n  <string name=\"detect\">检测</string>\n  <string name=\"goTo\">转到…</string>\n  <string name=\"print\">打印…</string>\n  <string name=\"viewMarkdown\">檢視 markdown…</string>\n  <string name=\"options\">选项</string>\n  <string name=\"viewFile\">檢視檔案</string>\n  <string name=\"openLast\">最后打开</string>\n  <string name=\"autoSave\">自動儲存</string>\n  <string name=\"wrap\">文字換列</string>\n  <string name=\"suggest\">建議</string>\n  <string name=\"highlight\">突顯語法</string>\n  <string name=\"theme\">主題</string>\n  <string name=\"light\">亮色</string>\n  <string name=\"dark\">暗色</string>\n  <string name=\"system\">系统</string>\n  <string name=\"white\">白</string>\n  <string name=\"black\">黑色</string>\n  <string name=\"retro\">復古</string>\n  <string name=\"size\">文字大小</string>\n  <string name=\"small\">小</string>\n  <string name=\"medium\">中</string>\n  <string name=\"large\">大</string>\n  <string name=\"typeface\">字體</string>\n  <string name=\"mono\">等寬字體</string>\n  <string name=\"normal\">比例字體</string>\n  <string name=\"sans\">无衬线</string>\n  <string name=\"serif\">衬线</string>\n  <string name=\"about\">關於</string>\n\n  <!--\n      Note for translators: You don't need to translate all these\n      translation credits below. Just the version, copyright, credit\n      for your translation and the licence. Also add your translation\n      credit here.\n  -->\n\n  <string name=\"version\" formatted=\"false\"><a\n  href=\"https://github.com/billthefarmer/editor/releases/latest\">%s</a>\\n\\n\n  組建時間 %s\\n\\n版權 \\u00A9 2017 Bill Farmer\\n\\n中文（繁體）譯者：<a\n  href=\"https://github.com/cges30901\">張修銘</a>\\n\\n授權 <a\n  href=\"https://www.gnu.org/licenses/gpl.txt\">GNU GPLv3</a>\n  </string>\n\n  <string name=\"tooLarge\">太大了 %s</string>\n  <string name=\"choose\">選擇檔案名稱</string>\n  <string name=\"loading\">載入中…</string>\n\n  <string name=\"modified\">\n    有未儲存的變更。您要儲存變更嗎？\n  </string>\n\n  <string name=\"changedReload\">\n    檔案已變更。您要重新載入嗎？\n  </string>\n\n  <string name=\"changedOverwrite\">\n    檔案已變更。您要覆寫它嗎？\n  </string>\n\n  <string name=\"ok\">確定</string>\n  <string name=\"reload\">重新載入</string>\n  <string name=\"overwrite\">覆寫</string>\n  <string name=\"discard\">捨棄</string>\n  <string name=\"cancel\">取消</string>\n\n</resources>\n"
  },
  {
    "path": "src/main/res/xml/filepaths.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<paths xmlns:android=\"http://schemas.android.com/apk/res/android\">\n  <cache-path name=\"cache\" path=\"/\" />\n</paths>\n"
  },
  {
    "path": "src/main/res/xml/shortcuts.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shortcuts\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    tools:ignore=\"UnusedAttribute\">\n  <shortcut\n      android:shortcutId=\"newFile\"\n      android:enabled=\"true\"\n      android:icon=\"@drawable/ic_launcher\"\n      android:shortcutShortLabel=\"@string/newFile\">\n    <intent\n        android:action=\"org.billthefarmer.editor.OPEN_NEW\"\n        android:targetPackage=\"org.billthefarmer.editor\"\n        android:targetClass=\"org.billthefarmer.editor.Editor\" />\n  </shortcut>\n</shortcuts>\n"
  }
]