Questions tagged [utf-16]

UTF-16 is a character encoding that represents Unicode code points using either 2 or 4 bytes per character.

UTF-16 is a character encoding that describes code points in byte sequences of either two or four bytes. It is therefore a variable-width character encoding.

The algorithm for encoding code points as UTF-16 is described in RFC 2781.

There are three flavors of UTF-16, little-endian, big-endian and with BOM (see ).

Related tags

1193 questions
-1
votes
1 answer

Hello, i have a text file that i want to write in UTF-16 unicode using python

for example i read from the file 1: ch="Hello world, this a stackoverflow example" i write in file 2 the unicode UTF-16, the output must be like that: output="\u0048\u0065\u006c\u006c\u006f \u0077\u006f\u0072\u006c\u0064\u002c…
Moun
  • 325
  • 2
  • 16
-1
votes
1 answer

In JavaScript, how does join vs += on a string handle utf encodings differently?

What is the difference between the below two operations that accounts for the one with join resulting in "÷C " where the other with reduce results in "÷C"? 1 // returns "÷C " ["f7","43"].map(x=>'0x'+ x).map(String.fromCharCode).join(''); 2 //…
-1
votes
1 answer

UTF-16 error, how to solve the unrecognized escape sequence?

This program is a translator program that takes some symbols and converts them to normal letters. The problem is, when I try to put some symbols like: allAlphabets.Add("[]/[]"); or: allAlphabets.Add("//"); , i get an error about the UTF-16 …
-1
votes
1 answer

Objective C, how to decode this UTF16 string?

I have a string like this, NSString *u = @"%u9ED1%u9AD4"; I need to decode this UTF16 string to obtain the unicode entity below: 黑體 I am trying this: NSData *fontNameData = [@"%u9ED1%u9AD4" dataUsingEncoding:NSUTF16StringEncoding]; NSString *l…
Sasanka Panguluri
  • 3,058
  • 4
  • 32
  • 54
-1
votes
1 answer

Convert code point(unicode) to UTF-16 and print in java

I am based on this article https://kishuagarwal.github.io/unicode.html I took for example: UTF-16 code point 0x1F9F0 In hexa: 0x1F9F0 In binary: 0001 1111 1001 1111 0000 Fallowing the explanation from article, should i have some thing like…
Bruno Rozendo
  • 317
  • 5
  • 17
-1
votes
1 answer

How can I use Font Awesome icons in a UTF-16 encoded html page?

I'm trying to use Font Awesome icons in my UTF-16 html pages but the icons don't show up normally, because of the encoding. Walking step by step, this works fine:
Václav
  • 430
  • 1
  • 7
  • 22
-1
votes
1 answer

How to decode utf-16 emoji surrogate pairs into uf8-8 and display them correctly in html?

I have a string which contains xml. It has the following…
mtotowamkwe
  • 2,407
  • 2
  • 12
  • 19
-1
votes
2 answers

How to convert utf-8 characters in utf-16 unicode - scala

Ref: https://www.branah.com/unicode-converter I'm new in scala and java and trying to writ a .properties file (in few languages like Chinese,french,German etc ) using scala for internationalization functionality. For that I'm using following…
J.K.A.
  • 7,272
  • 25
  • 94
  • 163
-1
votes
1 answer

þÿ getting appending to the beginig of the excel file causing regression

I am reading Chinese and Spanish data from the Database and writing into CSV file. I am using UTF-16. when I open CSV file in Excel þÿ is getting prepended. How do I avoid writing þÿ into CSV? FileOutputStream os = new FileOutputStream("s.csv",…
Bid
  • 1
  • 3
-1
votes
2 answers

How to read a UTF-8 file in binary mode and transform it into a UTF-16 file using C

I'm kind of new to this Unicode world, and I have no idea how to this using C. I'm not on a *nix system. I'm using fedora linux. I tried opening the UTF-8 file in binary mode, then reading each byte into an integer and then converting it to the…
Noda De Caju
  • 101
  • 1
  • 7
-1
votes
1 answer

Edit text in file(UTF16)

I want replace 1 word in text file (file format is not .txt) file Unicode is (UTF16) few text example: I D = " f f 0 3 4 a 9 2 - d d 9 f - 4 3 7 4 - a 8 a d - f 5 5 4 0 0 2 a 4 1 9 b " I S S U E _ D A T E = " 2 0 1 7 - 0 2 - 1 6 T 1 7 : 2 9 : 1 8…
reza
  • 1
-1
votes
1 answer

Can one guess character encoding looking at binary/hex data?

I have a file which begins as below (hex from od -x ) 8fae 3800 7c00 2200 4300 6800 6100 7200 corresponding characters are ®8 | " C h a r It was expected to be 8|"Char, starting with number 8 and a pipe character and so on. Is the…
dbza
  • 316
  • 1
  • 5
  • 19
-1
votes
1 answer

Attempting to discover unicode code point for a character

I have a character that when viewed in a hex editor is shown as: FF FE 08 27 meaning it's binary representation is (a four byte encoding): 11111111 11111110 00001000 00100111 Looking at the unicode table and description this doesn't seem to…
m.edmondson
  • 30,382
  • 27
  • 123
  • 206
-1
votes
1 answer

Unicode, UTF-8, UTF-16 and UTF-32 questions

I read a lot about Unicode, ASCII, code pages, all the history, the invention of UTF-8, UTF-16 (UCS-2), UTF-32 (UCS-4) and who use them and so on, but I still having some questions that I tried hardly to find answers but I couldn't and I hope you to…
SH.0x90
  • 532
  • 2
  • 7
  • 19
-1
votes
1 answer

How many bytes does a phrase have in different encodings

The task is - consider the Spanish phrase "¡Aquí!" How many bytes will it have in the ISO-8859-1 encoding? How many in UTF-8? How many in UTF-16? How many in UTF-32? My solution is - ISO 8859-1 = 6 bytes - UTF-8 =8 bytes - UTF-16 = 12 bytes -…