View Issue Details

IDProjectCategoryView StatusLast Update
0006735Multi Theft Auto : San AndreasServerpublic2012-01-24 19:44
ReporterWAssigned Toccw 
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
PlatformOSLinuxOS Version
Product Version 
Target Version1.3Fixed in Version1.3 
Summary0006735: Localisation support is broken! tonumber("12.12") returns nil!
Description

Localisation support is broken! tonumber("1.2") returns nil on systems that use commas to separate decimal places!

Following code:

value="12.12"
outputDebugString(value)
outputDebugString(type(tonumber(value)))

value="12,12"
outputDebugString(value)
outputDebugString(type(tonumber(value)))

on server, returns:
12.12
nil
12,12
number

on client, returns:
12.12
number
12,12
nil

It affects everything and is reproducible always on systems with locales that use , to separate decimal places.

Steps To Reproduce

run server with polish locale

export LC_ALL=pl_PL
export LANG=pl_PL
./mtaserver

execute code pasted above

TagsNo tags attached.

Activities

W

2011-12-19 09:49

viewer   ~~0015409

Additional notes: this bug was nonexisting in 1.1 release version (MTA:SA Server v1.1.1-release-3297).

Expected behaviour is to always use C locale to parse numbers and dates.

Probable work-around: use export LANG=C; export LC_ALL=C before starting mta-server.

This was probably breaked in r3303
http://code.google.com/p/mtasa-blue/source/detail?r=3303&url_prefix=p

Picard

2011-12-19 14:29

updater   ~~0015411

Issue automatically marked as fixed by mantisbot ( Fixed in http://code.google.com/p/mtasa-blue/source/detail?r=3561 )

Issue History

Date Modified Username Field Change