encoding of characters

à
é

i have some special characters shown as above in the screen.

How to convert them to corrsponding special character to display properly like  'a' with cap on top of it or apostophe on top etc?

any link or resource online to convert these encodings automatically
LVL 7
gudii9Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

CEHJCommented:
How does that differ from the following (still open) question?
https://www.experts-exchange.com/questions/29089384/entities-to-special-characters.html
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
gudii9Author Commented:
š      š      \u0161
what is difference between above 3 formats
0
rrzCommented:
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

gudii9Author Commented:
which one is better to keep in my code among these 3

š      š      \u0161

First one definitely messes up the display
i wonder why all below represent question mark
ě      ?
ł      ?
ź      ?
ś      ?
č      ?
0
rrzCommented:
which one is better to keep in my code among these 3
What code?   Anyway, the first in your list is a character entity. The second is a character. The third is a Unicode escape sequence.  
i wonder why all below represent question mark
The question mark is just a place holder. It tells us that the code can't figure what the encoding represent. It prints a ? in its place.  
I wrote some  test code.  First, here is test.html  
<!DOCTYPE html>
<html>
	<body>
			&#224; &#233; &#283; &#322; &#378;  &#347; &#269; &#353;
	</body>
</html>

Open in new window

In the browser,  it outputs
à é ě ł ź ś č š    
I couldn't display the same thing on the command line(maybe an expert will show us how to do that). But, I was able to display it in a JFrame.
import java.awt.*;
import javax.swing.*;
public class T {
    public static void main(String args[]) {
        JFrame frame = new JFrame("Testing Unicode");
        JPanel panel = new JPanel();
        panel.setLayout(new FlowLayout());
        JLabel label = new JLabel("\u00E0 \u00E9 \u011B \u0142 \u017A \u015B \u010D \u0161");
		label.setFont(new Font("Serif", Font.PLAIN, 28));
        panel.add(label);
        frame.add(panel);
        frame.setSize(500, 300);
        frame.setLocationRelativeTo(null);
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setVisible(true);
    }
}

Open in new window

 It prints the same string of characters  à é ě ł ź ś č š  in the JLabel.
0
CEHJCommented:
I couldn't display the same thing on the command line(maybe an expert will show us how to do that).

Windows has poor support for Unicode in a console. You might try setting a font in the console that looks promising (e.g. it has 'unicode' in its name) or
http://technojeeves.com/index.php/aliasjava1/107-enabling-windows-console-for-unicode
0
rrzCommented:
@CEHJ, thanks for explaining that.
0
CEHJCommented:
Yes - sorry about that. But thanks to rrz for concern
0
DansDadUKCommented:
As @rrz has very succintly explained, the character entity and Unicode code-point values are just different representations of the same character.

But the character will only display (in your browser or application window, or when printed) if the current font contains that character.
0
CEHJCommented:
It's important to realize that character entities are usually only used in marked-up documents such as html/xml
0
DansDadUKCommented:
@CEHJ: good point of clarification!

Outside of that environment, they wouldn't be interpreted, but just treated as character strings.
0
rrzCommented:
@Gerwin Jansen,  thanks for the cleanup and thanks for the mouse hover explanation.
0
Gerwin Jansen, EE MVETopic Advisor Commented:
@rrz - You're welcome ;)
0
rrzCommented:
This question is a duplicate of the question that CEHJ linked in his first comment.
I assisted by answering  some of gudii9's  follow up questions.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
HTML

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.