Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is the encoding name UTF8 or UTF-8?

Some httpclient requires me to give a string charsetµ.

I am wondering whether to give it UTF8 or utf8 or UTF-8?

Especially when calling Charset.forName(enc)

like image 280
user496949 Avatar asked Jul 15 '12 10:07

user496949


People also ask

Is UTF-8 the same as UTF-8?

There is no difference between "utf8" and "utf-8"; they are simply two names for UTF8, the most common Unicode encoding.

What type of encoding is UTF-8?

UTF-8 is a Unicode character encoding method. This means that UTF-8 takes the code point for a given Unicode character and translates it into a string of binary. It also does the reverse, reading in binary digits and converting them back to characters.

Is UTF-8 the default encoding?

Fortunately UTF-8 is the default per sé. When reading an XML document and writing it in another encoding, mostly this attribute will be patched too.

How do you tell if a file is UTF-8 encoded?

Open the file in Notepad. Click 'Save As...'. In the 'Encoding:' combo box you will see the current file format. Yes, I opened the file in notepad and selected the UTF-8 format and saved it.


1 Answers

Easier to use StandardCharsets.UTF_8 as it saves you having to deal with UnsupportedEncodingExceptions

like image 136
Julien Nioche Avatar answered Sep 21 '22 23:09

Julien Nioche