Using IUStringUnitsToAIReal, ignores European decimal [,]

Engaged ,
Feb 24, 2022 Feb 24, 2022

Copy link to clipboard

Copied

With my locale set to Germany, I'm using a comma decimal separator [,] and period thousands separator [.]. When IUStringUnitsToAIReal parses the text, it ignores the [,] decimal separator. My units are set to mm. I see in Illustrator's own fields, it's using the comma as decimal separator. AI is not using a thousands separator, which is not a problem here.

 

AIReal pts_;

std::string input_ = "1,5"; // From Adobe header: The string to convert, which uses the localized international utilities (IU) decimal separator.

sAIUser->IUStringUnitsToAIReal(ai::UnicodeString(input_), &pts_);


pts_ is now set to 42.519685039370081, but should be 1/10 that (4.2519685039370081). Am I doing something wrong?

TOPICS
SDK

Views

39

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Engaged , Feb 25, 2022 Feb 25, 2022
I think I'm making progress. Working with Points as ruler units, "1,5" should equal 1.5, but instead I get 15. However: sAIUser->IUStringToAIReal(pts_, 4, us);// pts_ == 1.5!ai::UnicodeString us;sAIUser->IUAIRealToStringUnits(pts_, 4, us); // works! IUStringToAIReal and IUAIRealToStringUnits work as expected. I suspect there's a bug in IUStringUnitsToAIReal.

Likes

Translate

Translate
Engaged ,
Feb 25, 2022 Feb 25, 2022

Copy link to clipboard

Copied

LATEST

I think I'm making progress. Working with Points as ruler units, "1,5" should equal 1.5, but instead I get 15. However:

 

sAIUser->IUStringToAIReal(pts_, 4, us);

// pts_ == 1.5!

ai::UnicodeString us;

sAIUser->IUAIRealToStringUnits(pts_, 4, us); // works!

 

IUStringToAIReal and IUAIRealToStringUnits work as expected. I suspect there's a bug in IUStringUnitsToAIReal.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines