Questions tagged [utf-16le]

UTF-16LE is the little endian variety of UTF-16 without BOM.

UTF-16LE is the little endian variant of . While text in UTF-16 might be expected to signal endianness by starting with a Byte-Order-Mark, text in UTF-16LE should not. UTF-16LE can encode all code points in two or four bytes, like UTF-16.

UTF-16LE is the encoding used for the API, and many frameworks there. Most stored text on Windows is actually instead . Text in both formats on Windows often start with a BOM, which can confuse software not expecting it.

For any more details, consider instead.

82 questions
0
votes
1 answer

Encode file in UTF-16LE in PHP with Byte Order Mask (BOM)

I got a PHP that receive data in POST by my Javascript and I want to write these data in a CSV file. I need to encode this file in UTF-16LE. What I try is : 1) $data = $_POST['data']; $data = iconv("UTF-8","UCS-2LE",$data); The result when I open…
user3214296
  • 73
  • 1
  • 11
0
votes
0 answers

Java FileOutputStream too many line separators

So I'm writing a tool for a game for modding, it's working all fine, but I got a problem with writing Strings to a file. The game needs the file encoded in UTF-16LE BOM, so my code looks something like this: public void save() { FileOutputStream…
0
votes
3 answers

How do I write UTF-8 data to a UTF-16LE file using PHP?

Given a string of UTF-8 data in PHP, how can I convert and save it to a UTF-16LE file (this particular file happens to be destined for Indesign - to be placed as a tagged text document). Data: $copy = "\n"; $copy .=…
murdaugh
  • 121
  • 1
  • 3
0
votes
1 answer

Using Rails to Encode Text to UTF-16LE for Windows

I have a PLC application that requires the Unicode format of UTF-16LE to support accented characters. I build the text and convert it with: str = Iconv.conv("utf-16le", "utf-8", str) Then I output the file with the following: send_data str,…
badams
  • 252
  • 3
  • 14
0
votes
2 answers

Java UTF-16LE Weird Error That Stumped My Professor

As described above, I'm having an issue with UTF-16LE in Java. When I run my code, it usually encrypts, decrypts, and prints the message correctly. Sometimes it loses two of the encrypted characters and other times it prints out a non-english…
-1
votes
1 answer

Reading a Binary File with UTF16 format

In C language, I am trying to read a Binary file in UTF16 format. I tried to this; binaryFile = fopen("data.dat", "rb, ccs=UTF16LE"); And it did not work. I need to do this without using the UTF16 reading library specifically, and I can't think of…
bebibabi
  • 29
  • 2
-1
votes
1 answer

Unicode writing fail: charmap can't encode character

I have a text in which I have a summary. I grab this summary with some regexes as the text always has the same structure. Within the summary there is a sentence "NAME is classified as ....", and I have to replace it by a title grabbed in the text…
Ando Jurai
  • 1,003
  • 2
  • 14
  • 29
1 2 3 4 5
6