Modules/MTA-MySQL/mysql get character set info

From Multi Theft Auto: Wiki
Revision as of 17:04, 13 January 2008 by Ryden (talk | contribs) (New page: __NOTOC__ Retreives information about a character set ==Syntax== <syntaxhighlight lang="lua"> string, string, string, string, int, int mysql_get_character_set_info ( MySQLConnection handler, string char...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Retreives information about a character set

Syntax

string, string, string, string, int, int mysql_get_character_set_info ( MySQLConnection handler, string character_set_name )

Required arguments

  • handler: A valid MySQL link
  • character_set_name: The character set name

Returns

The character set information:

  • The charset name
  • The charset collation
  • The charset comment
  • The charset directory
  • Multi byte character min. length
  • Multi byte character max. length

Example

Example 1:

local name, collation, comment, directory, mbminlen, mbmaxlen =
      mysql_get_character_set_info(handler, "utf8") -- We will return information about the charset "utf8"

outputDebugString("UTF-8 charset information:\n" ..
                  "name: " .. name .. "\n" ..
                  "collation: " .. collation .. "\n" ..
                  "comment: " .. comment .. "\n" ..
                  "directory: " .. directory .. "\n" ..
                  "mbminlen: " .. mbminlen .. "\n" ..
                  "mbmaxlen: " .. mbmaxlen)

See also