Category: Encoding

Create URL shortner or Tiny URL like bitly, goog.gl in Java 0

Create URL shortner or Tiny URL like bitly, goog.gl in Java

Most of us would have used URL shortner or tiny URL websites like bit.ly and goo.gl. These sites help in shortening the long URLs which can be easily shared on twitter and other places...

How to find character encodings supported in Java SE 0

How to find character encodings supported in Java SE

Run this code to find all available character encodings supported by your current JVM. If you have text in some encoding which is not present in this list, you will end up showing messed...

Reading UTF-8 files – FileReader or FileInputStream? 0

Reading UTF-8 files – FileReader or FileInputStream?

FileReader and FileInputStream are two stream APIs for reading data from the files. FileReader is preferred when you are dealing with text files and want to read characters instead of bytes. A character can...

How are characters represented in UTF-16 format 0

How are characters represented in UTF-16 format

In UTF-16 is variable length encoding which requires either 2 bytes or 4 bytes to represent a character. It is better than UTF-32 in the sense size of files will be around half the...

How are characters represented in UTF-8 encoding 0

How are characters represented in UTF-8 encoding

UTF-8 is a character encoding capable of encoding all possible characters, or code points, defined by Unicode. UTF-8 encodes each of the 1,112,064 valid code points in Unicode using one to four 8-bit bytes. To...

Difference between UTF-8, UTF-16 and UTF-32 Encoding 0

Difference between UTF-8, UTF-16 and UTF-32 Encoding

UTF-32 In UTF-32 all of characters are coded with 32 bits. The main advantage of UTF-32 is that the Unicode code points are directly indexable. Finding the Nth code point in a sequence of...

What is difference between charset and encoding? 0

What is difference between charset and encoding?

Charset As the name suggests it actually is a set of characters. Character Sets (ASCII, EBCDIC, UNICODE) would be the numeric representation of characters, independent of storage considerations.A ‘character set’ is just what it...