Character encoding in cPanel file manager

Character encoding can be a huge issue if you are not using standard characters in your website. If you open a file in Code Editor within cPanel and do not choose the correct character set, the editor may delete code, or display characters incorrectly. If your website uses the English Alphabet and standard characters, the character encoding is usually not an issue since the standard encoding of the editor is UTF-8.
 
 
If you use different character encoding, such as EUC-JP, you will need to adjust the character encoding in cPanel.

1. Log into cPanel
2. Go to File Manager
3. Navigate to the file you want to edit
4. Right click on the file you wish to work with and select "code editor"
5. Select the correct character encoding from the dropdown menu
Code: [Select]
6. Click "Edit"
Now, the code should display properly. Remember, if you are using standard encoding, you can leave the default setting to UTF-8.
 
 
This article covers what to look for in the character encoding check that appears when editing a file within the cPanel File Manager. Let's also note that in character encoding, the UTF-8 is considered the best format and the different character encodings are not usually compatible with each other.
Now we proceed to the issue of character encoding check that appears in a file when editing in file manager but before we do that,let us give some background information that will give you a general understanding of Character Encoding.


Understanding Character Encoding

People may sometimes not understand you because of the text you use in writing. Stating what character encoding you se will help them to be able to read your text.
 
For example, your text may be displayed in away that is different from what you intended.
 
A lack of character encoding information actually spoil the readability of displayed text, and may also not allow search engine readability for your content.
 
 
Further reading:
 

 

 

So What Exactly is Character Encoding?

Words and sentences in text are created from characters. Examples of characters include the Latin letter á or the Chinese ideograph 請. You may not be able to see some of the characters in this page because you don't have the necessary fonts. This page is encoded in UTF-8.

Characters that are needed for a specific purpose are grouped into a character set (also called a repertoire). (To refer to characters in an unambiguous way, each character is associated with a number, called a code point.)

The characters are stored in the computer as one or more bytes.

What character encoding does is to provide a key to unlock (ie. crack) the code. It is a set of mappings between the bytes in the computer and the characters in the character set. Without the key, the data looks like garbage. So character encoding enables you to have these garbage presented as real information you can read and understand.

The misleading term charset is often used to refer to what are in reality is character encodings.

So, when you input text using a keyboard or in some other way, the character encoding maps the characters you choose to specific bytes in computer memory, and then displays the text it reads the bytes back into characters.

Now, you understand what character encoding is all about. In most cases, you will not need to understand the details and how these data are translated into readable format.


Character Encoding in the cPanel Filemanger

In the cPanel File Manager, if you are running on a modern server with WHM build 64.0.22 and above, you have one editor. The code editor has been depreciated in these versions. Once you have selected the file you wish to edit, choose either option from the File Manager menu (or right click the file and choose one of the editors).

    When you open a file with either the Text Editor in the cPanel File Manager, an encoding check is performed by default. Normally, this encoding check will correctly detect the character encoding of a file.

    Of course, it doesn't hurt to double check the encoding. If you know that your file is in a different encoding than what is shown by the check, you can choose the correct encoding from the drop down menu.

    Click Edit to finish opening your file.

    If you accidentally disable the encoding check and would like to re-enable it, you can do so in the File Manager Settings. At the top left of the page, click the Settings link next to the File Manager heading.

    In the Preferences pop up window, deselect the box next to Disable Character Encoding Verification Dialogs and click the Save button.

    re-enable-encoding-check

Character encoding can also apply to databases. If you have database tables that you need to convert to a different character set and collation.

To modify your files through File Manager.

    Please do the following:    Login to cPanel with the authentication requirements.
Click on filemanager in the cPanel section of your website control panel. Next, click root and Show hidden files - this will allow you access to hidden system files which ordinarily will not be displayed if this option is not checked.

Another safe method is to download the file you intend to modify to your local computer. This can be done by highlighting the file by taping it and then clicking the download button from the top menu bar. You can then open the file with a text editor lie "context editor" or notepad and then proceed to edit it. Once you finish and save your changes, you can use the filemanager upload button to re-upload to the same directory, overwriting the existing file.

Next, you need to locate the file. To do this, you need to trace the file you want to alter and check the box next to it.
    You have several options at the top: copy, move, delete, edit. Click the option you want.

To be able to delete a file using the cPanel filemanager, you will need to highlight the file you want to delete and click the delete button

To edit a file, you will check the box next to the file you want to edit and click the edit button. You can choose to edit as text or use the code view. The major advantage of the code view is that it allows you to search a particular text and locate the section you may want to edit quite easily.

Remember to save your work once you are done with editing.

File Manager editors

Filemanager editor allow you to make immediate changes to your web site without the need to upload a new version of the file. cPanel has three editors that you can use to edit files directly on the web server:

    A plain text editor for editing text files. This editor is intended for use with plain text files, such as configuration files.
    A Code Editor for editing files that contain code. This editor is intended for use with PHP files, JavaScript files, CSS files, and so on. It provides common code editing features such as syntax highlighting and line numbering.
    An HTML Editor that is intended for use with HTML files. This editor provides WYSIWYG (What You See Is What You Get) functionality. It provides many of the features that users of word processing programs are familiar with, such as spell check, formatting toolbars, and so on.

In most modern servers running on cPanel WHM Version 64.0.22 and above, the HTML editor has been depreciated and no longer available. The code editor and html editor functions have been built into the text editor function.

Viewing a file

You may not always need to edit a file. If you just want to have a quick look at a file's contents, you can view it without opening an editor.

To view a file in File Manager, follow these steps:

    In the File Manager main window, select the file that you want to view.
    Click the View icon. The file's contents appear in a new page.

Editing a file using the text editor

To edit a text file, follow these steps:

    In the File Manager main window, select the file that you want to edit.
    Click the Edit icon.
    Click Edit. The file's contents appear in a new page, ready for editing.
    Save your changes when you are done, click Save Changes.
    To close the editor, click Close

What if the file you want to edit is zipped?

To edit a file that is zipped, you will first need to unzip the file and proceed to open the folder, locate the file you intend to edit and proceed with your editing.
   That is it. You now know how to edit, create or delete a file in File Manager.

How to make an image file as default homepage

You may want a custom homepage and want to use an image as your default landing page. This tutorial takes you through the steps that will help you achive that.

  •     Log into your cPanel dashboard

    Upload your image file via the File Manager. Be sure you select the checkbox for Show Hidden Files (dotfiles). It is highly recommended you upload the image into the root folder for your domain. For the primary domain, this will be the public_html. To enter that folder, select the Web Root radio button.

    Once the image is uploaded into the main folder, find the .htaccess file. Highlight the file and click on the Edit tool located in the toolbar across the top of the page. Another popup may appear, simply click the Edit button to continue.

    Once in the editor, at the top of the file, enter the command DirectoryIndex <image file name> where the <image file name> is the name of the image you want to display. For example, if you upload an image named comingsoon.jpg your code would look like the sample below:

    DirectoryIndex comingsoon.jpg

    Once you have entered the code, click on the Save Changes button to finalize the change. You can now visit your website and see the image as your homepage.

How to use the html text editor in cpanel

Log into your cPanel : www.(yourdomain).com/cpanel.
Enter your username and password issued in your Account Activation Email.
Click on File Editor and look for your website files in the public_html directory.

Highlight the file you wish to edit and click on the HTML Editor - wait for the editor to load in.

How to locate and edit hidden/system files

Hidden or system files are ordinarily not visible when you access filemanager exept you check the box which enables you to view them. A good example of a very useful system/hiddenfile is the .htaccess file.

Let's now loo at how to edit these files.

Under Linux, the files starting with dot (.) are hidden system files.

They can be edited in two ways:

1. Access the file with File Manager - open cPanel -> File manager or Legacy File Manager. Click on the gear icon at the top right corner, a new window will appear. There you should select the radio button for "home directory" and check the  "show hidden files" box. After that you should be able to view/edit the chosen hidden file.

2. The alternative method for editing your hidden files is by using the edit functionality included in your FTP client, for example FileZilla.

There are cases where the hidden files do not show up. Never worry,just go to file manager, click the gear icon by the top right and in the window that show up, click on "show hidden files". This is applicable with the cPanel "paper_lantern" theme which is currently the default theme in cpanel.

  • 2 Users Found This Useful
Was this answer helpful?

Related Articles

I have a full backup of account through cPanel. How do I restore it?

It is recommended that you maintain healthy backup of your website and possibly download the...

How To Create, Edit, and Delete a File in CPanel Using File Manager

This tutorial will be useful for you to understand how to create a file, edit a file or delete...

How to Create a MySQL Database, a User and Delete Database in Cpanel

Your cPanel allows you to easily create a MySQL database, create database users, and assign...

How do I create and remove an Addon Domain?

An add-on domain is a separate domain name that you add to your web hosting subscription with...

How to Set Up and Delete a Cron Job

A cron job allows you to run a certain command at times set by the job. For example, you could...

Powered by WHMCompleteSolution