Problem with negative values in InputField
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Re: Problem with negative values in InputField
I have had problems with the minus sign since I started using FreeCAD.
QD solution I've used is to copy-paste.
FreeCAD minus −
Swedish minus -
Hope the difference is visible in all browsers
OS: Debian GNU/Linux 7.6 (wheezy)
Platform: 64-bit
Version: 0.14.2751 (Git)
Branch: master
Hash: 16e873310689f055fb249c69a5c8422b3eef1fa7
Python version: 2.7.3
Qt version: 4.8.2
Coin version: 3.1.3
SoQt version: 1.5.0
OCC version: 6.5.4
QD solution I've used is to copy-paste.
FreeCAD minus −
Swedish minus -
Hope the difference is visible in all browsers
OS: Debian GNU/Linux 7.6 (wheezy)
Platform: 64-bit
Version: 0.14.2751 (Git)
Branch: master
Hash: 16e873310689f055fb249c69a5c8422b3eef1fa7
Python version: 2.7.3
Qt version: 4.8.2
Coin version: 3.1.3
SoQt version: 1.5.0
OCC version: 6.5.4
sorry for my outrageous English, but I have a bad excuse
Re: Problem with negative values in InputField
OK, it's the same unicode char.
Re: Problem with negative values in InputField
Hi Werner, are you sure? They display differently for me in Firefox so wouldn't that mean that they must have a different Unicode values?wmayer wrote:OK, it's the same unicode char.
Jim
Re: Problem with negative values in InputField
The swedisch have their own minus Impressive!
I will add that unicode to the parser....
I will add that unicode to the parser....
Stop whining - start coding!
Re: Problem with negative values in InputField
Yes, at least in Debian wheezy.The swedisch have their own minus Impressive!
This and all other local deviations is something that the UN should standardize.
sorry for my outrageous English, but I have a bad excuse
Re: Problem with negative values in InputField
I have the exact same (I presume) error on Mac OSX using Swedish locale. Filed a bug here: http://www.freecadweb.org/tracker/view.php?id=1627
Thanks to wmayer for linking them.
Thanks to wmayer for linking them.
Re: Problem with negative values in InputField
I meant it's the same unicode char as DevJohan has -- just in case there are multiple minus signs in unicode defined.jmaustpc wrote:Hi Werner, are you sure? They display differently for me in Firefox so wouldn't that mean that they must have a different Unicode values?wmayer wrote:OK, it's the same unicode char.
Jim
Re: Problem with negative values in InputField
Under Windows one can set the "minus" inside the control panel for negative numbers. After this change I can confirm all the trouble.
Re: Problem with negative values in InputField
Something I dug out from the forum: viewtopic.php?f=10&t=572&start=10#p4045
Re: Problem with negative values in InputField
A few more things we have to beware of:
Code: Select all
from PySide import QtCore
print "Negative signs:"
for i,j in QtCore.QLocale.Language.values.iteritems():
l=QtCore.QLocale(j)
if ord(l.negativeSign()) != ord('-'):
i, l.negativeSign().encode("utf-8")
print ""
print "Positive signs:"
for i,j in QtCore.QLocale.Language.values.iteritems():
l=QtCore.QLocale(j)
if ord(l.positiveSign()) != ord('+'):
i, l.positiveSign().encode("utf-8")
print ""
print "Decimal points:"
for i,j in QtCore.QLocale.Language.values.iteritems():
l=QtCore.QLocale(j)
if not ord(l.decimalPoint()) in (ord(','),ord('.')):
i, l.decimalPoint().encode("utf-8")
print ""
print "Group separator:"
for i,j in QtCore.QLocale.Language.values.iteritems():
l=QtCore.QLocale(j)
if not ord(l.groupSeparator()) in (ord(','),ord('.')):
i, l.groupSeparator().encode("utf-8")
print ""
print "Percent:"
for i,j in QtCore.QLocale.Language.values.iteritems():
l=QtCore.QLocale(j)
if ord(l.percent()) != ord('%'):
i, l.percent().encode("utf-8")
print ""
print "Zero digit:"
for i,j in QtCore.QLocale.Language.values.iteritems():
l=QtCore.QLocale(j)
if ord(l.zeroDigit()) != ord('0'):
i, l.zeroDigit().encode("utf-8")
print ""
Script wrote: Negative signs:
('NorthernSami', '\xe2\x88\x92')
('Swedish', '\xe2\x88\x92')
('Faroese', '\xe2\x88\x92')
('Latvian', '\xe2\x88\x92')
('Colognian', '\xe2\x88\x92')
('RhaetoRomance', '\xe2\x88\x92')
('Icelandic', '\xe2\x88\x92')
('Lithuanian', '\xe2\x88\x92')
('Greenlandic', '\xe2\x88\x92')
('SwissGerman', '\xe2\x88\x92')
('NorwegianNynorsk', '\xe2\x88\x92')
('Nynorsk', '\xe2\x88\x92')
Positive signs:
Decimal points:
('Urdu', '\xd9\xab')
('Arabic', '\xd9\xab')
('Pashto', '\xd9\xab')
('Bengali', '\xd9\xab')
('Persian', '\xd9\xab')
('Assamese', '\xd9\xab')
('Kurdish', '\xd9\xab')
Group separator:
('Walser', '\xe2\x80\x99')
('Estonian', '\xc2\xa0')
('CentralMoroccoTamazight', '\xc2\xa0')
('Zarma', '\xc2\xa0')
('Yangben', '\xc2\xa0')
('Byelorussian', '\xc2\xa0')
('Ukrainian', '\xc2\xa0')
('Bulgarian', '\xc2\xa0')
('KoyraboroSenni', '\xc2\xa0')
('French', '\xc2\xa0')
('Duala', '\xc2\xa0')
('Sesotho', '\xc2\xa0')
('Finnish', '\xc2\xa0')
('JolaFonyi', '\xc2\xa0')
('NorthernSami', '\xc2\xa0')
('Aghem', '\xc2\xa0')
('Slovak', '\xc2\xa0')
('Urdu', '\xd9\xac')
('Polish', '\xc2\xa0')
('Kirghiz', '\xc2\xa0')
('Xhosa', '\xc2\xa0')
('Swedish', '\xc2\xa0')
('Fulah', '\xc2\xa0')
('Zulu', '\xc2\xa0')
('Norwegian', '\xc2\xa0')
('SouthNdebele', '\xc2\xa0')
('Afrikaans', '\xc2\xa0')
('Uzbek', '\xc2\xa0')
('NorthernSotho', '\xc2\xa0')
('Latvian', '\xc2\xa0')
('Colognian', '\xc2\xa0')
('Kabyle', '\xc2\xa0')
('Arabic', '\xd9\xac')
('RhaetoRomance', '\xe2\x80\x99')
('Bafia', '\xc2\xa0')
('Breton', '\xc2\xa0')
('Pashto', '\xd9\xac')
('Ewondo', '\xc2\xa0')
('Hungarian', '\xc2\xa0')
('Russian', '\xc2\xa0')
('Kazakh', '\xc2\xa0')
('Basaa', '\xc2\xa0')
('Bengali', '\xd9\xac')
('Siswati', '\xc2\xa0')
('SwissGerman', '\xe2\x80\x99')
('Tsonga', '\xc2\xa0')
('Morisyen', '\xc2\xa0')
('Czech', '\xc2\xa0')
('Tachelhit', '\xc2\xa0')
('Persian', '\xd9\xac')
('Mongolian', '\xc2\xa0')
('NorwegianNynorsk', '\xc2\xa0')
('LastLanguage', '\xc2\xa0')
('Setswana', '\xc2\xa0')
('Tasawaq', '\xc2\xa0')
('Akan', '\xc2\xa0')
('NorwegianBokmal', '\xc2\xa0')
('Assamese', '\xd9\xac')
('Kurdish', '\xd9\xac')
('Walamo', '\xe2\x80\x99')
('KoyraChiini', '\xc2\xa0')
('Kwasio', '\xc2\xa0')
('Portuguese', '\xc2\xa0')
('Venda', '\xc2\xa0')
('Nynorsk', '\xc2\xa0')
Percent:
('Urdu', '\xd9\xaa')
('Tibetan', '\xd9\xaa')
('Burmese', '\xd9\xaa')
('Arabic', '\xd9\xaa')
('Oriya', '\xd9\xaa')
('Pashto', '\xd9\xaa')
('Bengali', '\xd9\xaa')
('Persian', '\xd9\xaa')
('Assamese', '\xd9\xaa')
('Kurdish', '\xd9\xaa')
Zero digit:
('Bodo', '\xe0\xa5\xa6')
('Urdu', '\xdb\xb0')
('Tibetan', '\xe0\xbc\xa0')
('Burmese', '\xe1\x81\x80')
('Arabic', '\xd9\xa0')
('Oriya', '\xe0\xad\xa6')
('Pashto', '\xdb\xb0')
('Bengali', '\xe0\xa7\xa6')
('Persian', '\xdb\xb0')
('Assamese', '\xe0\xa7\xa6')
('Kurdish', '\xd9\xa0')