We're updating the issue view to help you get more done. 

u_fsettransliterator fails for "Latin-Name" transliteration

Description

Description

ICU 63.1

Either I'm using the API incorrectly or there is a bug in u_fsettransliterator(). When I transliterate with something like Latin-Greek where the graphemes match up one-to-one it works properly, but when I try Latin-Hex or Latin-Name it outputs garbage. Here is the essence of the code:

in = u_finit(stdin, NULL, NULL);
out = u_get_stdout();

t = utrans_openU(xform_id, -1, UTRANS_FORWARD, NULL, -1, &pe, &status);
u_fsettransliterator(out, U_WRITE, t, &status);

while ((c = u_fgetcx(in)) != U_EOF)
u_fputc(c, out);

Full test program

Test program: trans-stream.c.

This works as expected:

echo "ioannis" | ./trans-stream Greek
--> ἰοαννις

This fails:

echo "hi" | ./trans-stream Name
--> garbage

Status

Assignee

Steven R. Loomis

Reporter

Joe Nelson

Labels

None

Reviewer

None

Time Needed

Minutes

Start date

None

Components

Fix versions

Priority

minor