Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I set encoding to ANSI in PhpStorm?

Tags:

ide

phpstorm

I'm working in an environment where I'm the only one using PhpStorm. The rest of my coworkers are using PhpDesigner and in that IDE, they are using "File Encoding: ANSI" which I don't seem to find in PhpStorm.

How do I set the file encoding to ANSI in PhpStorm?

like image 823
Weblurk Avatar asked Feb 07 '14 08:02

Weblurk


People also ask

What is ANSI encoding?

ANSI and UTF-8 are both encoding formats. ANSI is the common one byte format used to encode Latin alphabet; whereas, UTF-8 is a Unicode format of variable length (from 1 to 4 bytes) which can encode all possible characters.

How do I change ANSI in UTF-8?

Try Settings -> Preferences -> New document -> Encoding -> choose UTF-8 without BOM, and check Apply to opened ANSI files . That way all the opened ANSI files will be treated as UTF-8 without BOM. For explanation what's going on, read the comments below this answer.


1 Answers

ANSI can refer to one of several different character sets see this question for details. Assuming that you are working on US or Western European this should correspond to the windows 1252 character set, which you can set in the File>Settings>File Encoding panel. You can set the default encoding for the IDE as well as special cases for individual projects, directories and files. This information is valid for version 5 of PhpStorm but I expect that this particular settings option will be similar across the different versions.

With newer version of phpstorm, you will find the file encoding in File>Settings>Editor>File Encodings

like image 93
Vishal Avatar answered Nov 15 '22 08:11

Vishal