python - Longest 200 byte string - database validation max_length -


so, working specification dictates byte length given variable (200 bytes) provided end users/apps.

using python string, maximum character length of string, meets 200 bytes, , therefore can specify max_length setting of database field?

(equally may missing in byte-unicode conversion!)

depends on encoding. utf-32 use 4 bytes pr char, utf-8 use single byte english text, 2 bytes european languages can go 4 mathematical symbols, chinese/japanese/etc. so, 200 bytes enough fit 50 char long string... unless 5-byte per char encoding exists(?) :)


Comments

Popular posts from this blog

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -