Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Portuguese accents not working on PHPStorm

Tags:

phpstorm

Recently on a fresh Ubuntu installation, suddenly PHPStorm stopped allowing me to use words with portuguese accents.

For example:

Trying TILDE+A should result in: ã
Instead it results in: a

And this happens with other accents like:

Trying DIACRITICAL SIGN+E should result in: é
Instead it results in: e

Currently the laptop configuration is as follows:

  • OS: Ubuntu 15.04
  • Java: OpenJDK 8 (OpenJDK 7 did not worked also)
  • PHPStorm 8.0.3
  • Keyboard: Portuguese

Note 1: I think the problem may be related with key bindings once that the standalone key c-cedilla works just fine.

Note 2: My mother language isn't English so errors may occur, feel free to correct me. I appreciate it.

Any further help would be appreciated, thanks a lot!

like image 524
João Cerqueira Avatar asked Dec 15 '22 14:12

João Cerqueira


2 Answers

Well, so after some days struggling against this problem I finally found out what I already expected since the beginning, this is a problem related to java itself.

In order for special characters to work we've to clean up the XMODIFIERS environment variable, like so:

# Command to change the environment variable XMODIFIERS
export XMODIFIERS=""
# PhpStorm run, for testing if it worked
pstorm

And for me it did work!

So, after testing I just added the export command to my ~/.bashrc file so this change takes effect every time and not only that one when we've changed it manually in a terminal window. In the end of your .bashrc file paste the following (same command as above):

export XMODIFIERS=""

I got the tip from here: https://askubuntu.com/a/581769/410364

like image 106
João Cerqueira Avatar answered Jan 14 '23 00:01

João Cerqueira


For some reason, add the export XMODIFIERS="" on rc file didn't work (put it on .bashrc and in the .zshrc). Even put in .profile file doesn't work. So, I create a shell file with:

export XMODIFIERS=""

/opt/PhpStorm-191.6183.95/bin/phpstorm.sh

and put that shell file in the PHPStorm .desktop file as a program filepath. It's work to me :)

like image 21
Spark Avatar answered Jan 14 '23 02:01

Spark