skybaks / pyplanet-cup_manager

Competition Management Plugin for Trackmania Pyplanet
GNU General Public License v3.0
6 stars 1 forks source link

Table output alignment is off for some special characters #62

Open skybaks opened 1 year ago

skybaks commented 1 year ago

example:

 #  CP(s)  Time       Player                  Payout
====================================================
 1    350  24:52.298   Ғ฿Ǐ»Huebi-Spectrum       1000
 2    350  25:22.434  NoniSmurf                  700
 3    350  25:25.008  ad'ama!                    500
 4    350  25:32.003  RocheSmurf                 400
 5    350  25:49.724  ➟ water.H₂O                300
 6    350  25:51.340   mx.X3kuba3XSmurf
 7    350  25:54.855  HaagseSmurf
 8    350  25:59.934   Ғ฿Ǐ»iceman
 9    350  26:21.016  mxMazerSmurf32/50
10    350  26:22.711  NADEO mx.eyeboSmurf
11    350  27:09.737  TherionSmurf
12    350  29:20.990  Moggie68Smurf
13    302  21:27.601  hypeboys.Cloud (07/50)
14    267  18:58.474  hypeboys.Bull
15    216  28:29.562  [$00✘ion] Roro
16    140  10:16.348  SpectrumV!nce™
17    126  27:06.325  TCM/$mNσrdρlaý 06
18     29   9:58.854  OpsicSmurf
19      5  16:25.545  Earl Hickey
20      3  14:07.208  jmfranco
reaby commented 1 year ago

can be due utf-8 can use double byte characters... if you count only bytes this can lead to offsync issues.

skybaks commented 1 year ago

Yeah, maybe if i add .encoding('utf-8') to the string it might count the characters right? Its worth trying