Clipboard external paste problem

fschuett shared this problem 10 years ago
Answered

Hello,

I tried to paste a html table into geogebra and it didn't work so I tried to

track it down.

I guess I found a bug in "adjustNumberString" in module "DataImport.java".


...

private static String adjustNumberString(String s, String decimalSeparator,

String groupingSeparator) {


...

String s2 = s.replaceAll(groupingSeparator, "");

if (!decimalSeparator.equals("."))

s2 = s2.replaceAll(decimalSeparator, ".");

...

The "replaceAll" call uses at least in Java 6 regular expressions and the dot (.) matches __any character__.

So each and every string is converted to "".


Prepending of "\\" + decimalSeparator in the "replaceAll" call fixes the problem.

I checked with the sources from "trunk" and the problem seems still to exist.


PS

I guess groupindSeparator needs to be escaped too, because in germany it is a dot(.).


Keep up your good work.


Thank you for this program.


Bye,

Frank

Comments (4)

photo
1

That's impressive speed. :-)


Thank you.

photo
1

4.2.5.0 online now, please test

photo
1

Hello,

I tested it and it works as expected, see screenshot:


40790c08598a1ad3e1d94ed87ebd911e


Thank you very much.


Bye,

Frank Schütte

© 2023 International GeoGebra Institute