This discussion is archived
1 Reply Latest reply: May 16, 2013 1:39 PM by jschellSomeoneStoleMyAlias RSS

Several methods of removing accentuated characters not working.

1009202 Newbie
Currently Being Moderated
Hi, I have been trying to remove accented characters from strings, replacing them by their no accentuate one equivalents.
The problem is that it is not working. And the problem ain't algorithm because I tried three different algorithms using copy and paste. Here is part of the output:
O welington capxaba ?? um pessimo jogador de futebol.
O welington capxaba ?? um pessimo jogador de futebol.
The first line is before removing the accentuated characters, so it is working as intended (The terminal not being able to show accentuated characters is irrelevant). The second line is where the problem happens. Should be converted to "O welington capxaba e um pessimo jogador de futebol". The original string it is: "O welington capxaba é um pessimo jogador de futebol" I think this problem can be related to a previous problem in which I wasn't able to compile the code. Here is a resumed version of the errors that I got:
Procurador de Texto/FileManager.java:116: error: unmappable character for encoding ASCII
         case '??': 
                    ^
Procurador de Texto/FileManager.java:116: error: unmappable character for encoding ASCII
         case '??': 
                      ^
and
Procurador de Texto/FileManager.java:116: error: unclosed character literal
         case '??': 
                  ^
Procurador de Texto/FileManager.java:116: error: unclosed character literal
         case '??': 
                       ^
This happened in lines like:
case 'ç':
. These two errors happened 88 times through the code, so I am not going to post all. Always in accentuated characters which are used in one of the algorithms.

I freed myself of them putting
 -encoding UTF8 
when calling javac

So I think these two problems are related. Any ideas?

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points