Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Different output in terminal in Ubuntu 14 and Ubuntu 16

I hope you can help me with my problem:

CONTEXT

I'm working on a Java application. Following java, instruction works properly in in Ubuntu 16, but It fails when deploying on an Ubuntu 14.

String test = "Für test with and without Ü".replaceAll("[^\\p{L}\\p{Nd}]+", ",");
System.out.println(test);

PROBLEM

German characters are not properly shown on ubuntu 14.04. In Ubuntu 16 works perfectly, like you can see in the images

Output in Ubuntu 16

enter image description here

Output in Ubuntu 14.04

enter image description here

I have to try to set locales in Ubuntu 14 but I don't really know what is the problem

Can anyone help me?

like image 546
Fran Roa Prieto Avatar asked Dec 20 '25 04:12

Fran Roa Prieto


1 Answers

Maybe you need to add the locale manually in Ubuntu 14.04. Try the following:

METHOD 1:

locale -a

This will list the supported locales.

sudo locale-gen de_DE.UTF-8

This will install the locale on your machine.

sudo update-locale

This will effect the changes.

METHOD 2:

You can also try downloading the required package by:

sudo apt-get install language-pack-DE

This should fix your problem of locales.

like image 90
pri Avatar answered Dec 21 '25 18:12

pri