3

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?

rajadilipkolli
  • 3,475
  • 2
  • 26
  • 49
Fran Roa Prieto
  • 385
  • 1
  • 3
  • 12

1 Answers1

1

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.

pri
  • 1,521
  • 2
  • 13
  • 26
  • Thanks! it works. The problem was actually a combination of two problems: the "locale" configuration and the way I was writing the content (was not UTF-8 by default) – Fran Roa Prieto Jan 20 '18 at 14:17