user210444
user210444

Reputation: 361

IBM ICU - String conversion functions

In IBM ICU C library are there any string to number conversion functions. Something like atoi and atoll.

I am looking for ICU functions for string conversions - Cross platform, cross compiler and 32 and 64 bit version.

  1. Function should throw an error. overflow or underflow.
  2. I thought using errno -- But errno is not set in all platforms For Ex: Windows atoi.
  3. strtol --> this function is for long data type. There is no function like strtoi.

Upvotes: 1

Views: 752

Answers (1)

Steven R. Loomis
Steven R. Loomis

Reputation: 4350

Use the NumberFormat class (C++) or unum.h interfaces (C) for string to number (i.e. parsing). Instead of errno, ICU uses an error code system (UErrorCode).

HTH

Upvotes: 0

Related Questions