File tree Expand file tree Collapse file tree 1 file changed +3
-9
lines changed
Expand file tree Collapse file tree 1 file changed +3
-9
lines changed Original file line number Diff line number Diff line change @@ -473,16 +473,11 @@ func TibiadataDateV3(date string) string {
473473
474474// TibiadataStringToIntegerV3 func
475475func TibiadataStringToIntegerV3 (data string ) int {
476-
477- // Make a Regex to say we only want letters and numbers
478- reg , err := regexp .Compile ("[^0-9]+" )
476+ returnData , err := strconv .Atoi (data )
479477 if err != nil {
480- log .Fatal ( err )
478+ log .Printf ( "[warning] TibiadataStringToIntegerV3: couldn't convert %s into an int. error: %s" , data , err )
481479 }
482- processedString := reg .ReplaceAllString (data , "" )
483- returnData , _ := strconv .Atoi (processedString )
484480
485- // Return of formatted date and time string to functions..
486481 return returnData
487482}
488483
@@ -506,8 +501,7 @@ func RemoveHtmlTag(in string) string {
506501
507502// TibiaDataConvertEncodingtoISO88591 func - convert string from UTF-8 to latin1 (ISO 8859-1)
508503func TibiaDataConvertEncodingtoISO88591 (data string ) (string , error ) {
509- data , err := charmap .ISO8859_1 .NewEncoder ().String (data )
510- return data , err
504+ return charmap .ISO8859_1 .NewEncoder ().String (data )
511505}
512506
513507// TibiaDataConvertEncodingtoUTF8 func - convert string from latin1 (ISO 8859-1) to UTF-8
You can’t perform that action at this time.
0 commit comments