Ticket #738 (closed enhancement: fixed)

Bug contains 8 commit(s) | SVN Diffs for #738

 

Opened 8 years ago

Last modified 7 months ago

Add X/Open sprintf field redordering

Reported by: marr(at)ugsolutions.com Assigned to: michaelow
Priority: minor Milestone: 4.0
Component: formatting Version: 1.6
Keywords: Cc:
Load: Xref: 2256
Java Version: Operating System: all
Project (C/J): ICU4C Weeks: 1
Review: jspieth

Description (Last modified by grhoten)

The addition of ISO/ANSI C-like functions u_sprintf, u_vsprintf, u_snprintf, and

u_vsnprintf has been proposed. I would recommend extending the implementation of those functions to include the field reordering feature that is specified in the X/Open standard.(See http://www.opengroup.org/onlinepubs/007908799/xsh/fprintf.html)

Example:

printf(translate("My dog %s has %d fleas\n"), dogname, n_fleas)

might print "My dog Rover has 10 fleas\n" if there is no translation, or if translate() returns "There are %2$d fleas on my dog %1$s\n" then it would print

"There are 10 fleas on my dog Rover\n" with the same data.

This is analogous to the reordering supported by the MessageFormat class.

Attachments

Change History

12/31/69 17:36:15 changed by notes2

FYI The $ is a variant character, and it may not be suitable in a formatting specification [grhoten 6/21/2003]

12/31/69 17:36:16 changed by notes

This requires a whole new parsing/formatting engine for both the file/string parts of ustdio.

12/31/69 17:36:17 changed by auditor

  • Wed Nov 29 15:46:23 2000 schererm moved from incoming to feature
  • 03/21/02 12:55:57 schererm moved from feature to formatting
  • 10/29/02 15:36:31 hshih changed notes2
  • 10/29/02 15:37:27 hshih changed notes2
  • 10/29/02 15:39:03 hshih changed notes2
  • 10/29/02 20:36:20 grhoten changed notes2
  • 10/29/02 20:36:20 grhoten changed notes
  • 10/30/02 16:22:47 schererm changed notes2
  • 10/30/02 16:22:47 schererm changed notes
  • 06/21/03 15:01:22 grhoten changed notes2
  • 06/21/03 15:01:22 grhoten changed notes
  • 06/23/03 14:36:36 hshih changed notes2
  • 06/23/03 14:36:36 hshih changed notes
  • 06/23/03 14:37:07 hshih changed notes2
  • 06/23/03 14:37:07 hshih changed notes
  • 06/23/03 18:01:53 grhoten changed notes2
  • 06/23/03 18:01:53 grhoten changed notes
  • 01/30/04 02:37:41 grhoten changed notes2
  • 01/30/04 02:37:41 grhoten changed notes
  • 07/19/04 19:03:29 mark changed notes2
  • 07/19/04 19:03:30 mark changed notes
  • Tue Oct 24 16:09:44 2006 grhoten changed notes2: weeks: "1" to "2",
  • Tue Oct 24 16:09:44 2006 grhoten changed notes
  • Tue Oct 24 16:11:25 2006 emmons changed notes2: target: "UNSCH" to "3.8Cand", weeks: "2" to "1",
  • Tue Oct 24 16:11:25 2006 emmons changed notes
  • Tue Oct 24 16:12:16 2006 emmons changed notes2: target: "3.8Cand" to "3.8Candidate",
  • Tue Oct 24 16:12:16 2006 emmons changed notes
  • Tue Nov 14 00:25:57 2006 srl changed notes2: target: "3.8Candidate" to "4.0",
  • Tue Nov 14 00:25:57 2006 srl changed notes

(follow-up: ↓ 5 ) 10/03/07 08:48:43 changed by yoshito

  • load changed.
  • project set to all.
  • java changed.
  • revw changed.

java.util.Formatter in Java 5 defines its own syntax extending ANSI C printf format specifier. ICU4J currently does not have corresponding implementation using ICU's own service object (such as DateFormat/NumberFormat. If such function is implemented in ICU, it is desired to use the compatible syntax with Java 5 Formatter.

(in reply to: ↑ 4 ) 10/03/07 08:57:59 changed by grhoten

  • keywords deleted.
  • project changed from all to ICU4C.
  • description changed.

This ticket is meant for extending the existing icuio framework for a specific feature. The java.util.Formatter has incompatible syntax with icuio because of the Java's ability to use objects natively. If a port of java.util.Formatter to ICU4J is desired, a new ticket should be opened.

10/03/07 21:22:21 changed by grhoten

  • summary changed from RFE: Add X/Open sprintf field redordering to Add X/Open sprintf field redordering.

10/18/07 12:10:03 changed by grhoten

  • owner changed from grhoten to michaelow.

11/06/07 10:25:02 changed by michaelow

  • revw set to grhoten.

11/06/07 15:45:37 changed by michaelow

  • status changed from new to assigned.

11/07/07 16:40:16 changed by michaelow

  • revw deleted.

02/15/08 12:19:42 changed by grhoten

  • priority changed from major to minor.

03/12/08 12:36:34 changed by michaelow

  • revw set to jspieth.

05/02/08 13:07:39 changed by jspieth

  • status changed from assigned to closed.
  • resolution set to fixed.

Add/Change #738 (Add X/Open sprintf field redordering)




Anti spam check: