Project

General

Profile

Actions

Bug #14934

open

iconv fails to convert U+FFFF

Added by Marcel Telka 4 months ago. Updated 4 months ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
lib - userland libraries
Start date:
Due date:
% Done:

0%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:
External Bug:

Description

illumos:

$ echo -ne "\xff\xff" | iconv -f UTF-16LE -t UTF-8 | od -t x1
Illegal sequence in stdin at offset 0
bad seq: \xff\xff\x00
0000000 3f
0000001
$ echo -ne "\xef\xbf\xbf" | iconv -f UTF-8 -t UTF-16LE | od -t x1
Illegal sequence in stdin at offset 0
bad seq: \xef\xbf\xbf
Illegal sequence in stdin at offset 1
bad seq: \xbf\xbf\x00
Illegal sequence in stdin at offset 2
bad seq: \xbf\x00\x00
0000000 3f 3f 3f
0000003
$

Linux:

$ echo -ne "\xff\xff" | iconv -f UTF-16LE -t UTF-8 | od -t x1
0000000 ef bf bf
0000003
$ echo -ne "\xef\xbf\xbf" | iconv -f UTF-8 -t UTF-16LE | od -t x1
0000000 ff ff
0000002
$
Actions #1

Updated by Marcel Telka 4 months ago

Please note the similar problem is with U+10FFFF too.

Actions

Also available in: Atom PDF