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?
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.
Copy link to clipboard
Copied
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.