Skip to content

Tag: unicode

Unicode text through socket in java

I am facing a tiny issue (I believe) in socket programming. When sending text from non-English languages, I get garbled results. After a lot of researching on google, I made some corrections. I changed getBytes() to getBytes(“UTF-8”) and tried to send some Arabic text. When connecting sockets loca…

How to display X-Bar statistics symbol in Java Swing label?

What’s the best way to insert statistics symbols in a JLabel’s text? For example, the x-bar? I tried assigning the text field the following with no success: Answer Html codes will not work in Java. However, you can use the unicode escape in Java Strings. For example: Also, here is a cool website f…

Java FileReader encoding issue

I tried to use java.io.FileReader to read some text files and convert them into a string, but I found the result is wrongly encoded and not readable at all. Here’s my environment: Windows 2003, OS encoding: CP1252 Java 5.0 My files are UTF-8 encoded or CP1252 encoded, and some of them (UTF-8 encoded fil…