aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2011-08-26 13:40:20 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2011-08-26 13:40:20 +0200
commit061a16256eef2c2df53e2e145d16f17270c2de82 (patch)
tree4fa541f3c177ec08577bba4c1a0f493ff6fbe6c5
parent6f612aac43ae32e75d05717922c0f7f0c4ab0007 (diff)
Add support for specifying client character set for MySQL database
-rw-r--r--NEWS4
-rw-r--r--doc/manual.xhtml36
2 files changed, 33 insertions, 7 deletions
diff --git a/NEWS b/NEWS
index 82a89fb..29f3c40 100644
--- a/NEWS
+++ b/NEWS
@@ -49,6 +49,10 @@ Version 1.6.0
more information, refer to Section 3.4, "Transactions" in the ODB
manual.
+ * Support for specifying the client character set for the MySQL database.
+ For more information, refer to Section 11.2, "MySQL Database Class" in
+ the ODB manual.
+
Version 1.5.0
* Support for the PostgreSQL database. The provided connection factories
diff --git a/doc/manual.xhtml b/doc/manual.xhtml
index 4c0686e..44bfc8b 100644
--- a/doc/manual.xhtml
+++ b/doc/manual.xhtml
@@ -8213,6 +8213,7 @@ namespace odb
const char* host = 0,
unsigned int port = 0,
const char* socket = 0,
+ const char* charset = 0,
unsigned long client_flags = 0,
std::auto_ptr&lt;connection_factory> = 0);
@@ -8222,6 +8223,7 @@ namespace odb
const std::string&amp; host = "",
unsigned int port = 0,
const std::string* socket = 0,
+ const std::string&amp; charset = "",
unsigned long client_flags = 0,
std::auto_ptr&lt;connection_factory> = 0);
@@ -8231,6 +8233,7 @@ namespace odb
const std::string&amp; host = "",
unsigned int port = 0,
const std::string* socket = 0,
+ const std::string&amp; charset = "",
unsigned long client_flags = 0,
std::auto_ptr&lt;connection_factory> = 0);
@@ -8240,6 +8243,7 @@ namespace odb
const std::string&amp; host,
unsigned int port,
const std::string&amp; socket,
+ const std::string&amp; charset = "",
unsigned long client_flags = 0,
std::auto_ptr&lt;connection_factory> = 0);
@@ -8249,12 +8253,14 @@ namespace odb
const std::string&amp; host,
unsigned int port,
const std::string&amp; socket,
+ const std::string&amp; charset = "",
unsigned long client_flags = 0,
std::auto_ptr&lt;connection_factory> = 0);
database (int&amp; argc,
char* argv[],
bool erase = false,
+ const std::string&amp; charset = "",
unsigned long client_flags = 0,
std::auto_ptr&lt;connection_factory> = 0);
@@ -8281,6 +8287,9 @@ namespace odb
const char*
socket () const;
+ const char*
+ charset () const;
+
unsigned long
client_flags () const;
@@ -8300,11 +8309,24 @@ namespace odb
connecting to the database. In MySQL <code>NULL</code> and an
empty string are treated as the same values for all the
string parameters except <code>password</code> and
- <code>socket</code>. The <code>client_flags</code> argument
- allows us to specify various MySQL client library flags. For more
- information on the possible values, refer to the MySQL C API
- documentation. The <code>CLIENT_FOUND_ROWS</code> flag is always set
- by the MySQL ODB runtime regardless of whether it was passed in the
+ <code>socket</code>.</p>
+
+ <p>The <code>charset</code> argument allows us to specify the client
+ character set, that is, the character set in which the application
+ will encode its text data. Note that this can be different from
+ the MySQL server character set. If this argument is not specified or
+ is empty, then the default MySQL client character set is used, normally
+ <code>latin1</code>. Commonly used values for this argument are
+ <code>latin1</code> (equivalent to Windows cp1252 and similar to
+ ISO-8859-1) and <code>utf8</code>. For other possible values
+ as well as more information on character set support in MySQL,
+ refer to the MySQL documentation.</p>
+
+ <p>The <code>client_flags</code> argument allows us to specify various
+ MySQL client library flags. For more information on the possible
+ values, refer to the MySQL C API documentation. The
+ <code>CLIENT_FOUND_ROWS</code> flag is always set by the MySQL ODB
+ runtime regardless of whether it was passed in the
<code>client_flags</code> argument.</p>
<p>The last constructor extracts the database parameters
@@ -8321,8 +8343,8 @@ namespace odb
</pre>
<p>The <code>--options-file</code> option allows us to specify some
- or all of the database options in a file with each option appearing
- on a separate line followed by a space and an option value.</p>
+ or all of the database options in a file with each option appearing
+ on a separate line followed by a space and an option value.</p>
<p>If the <code>erase</code> argument to this constructor is true,
then the above options are removed from the <code>argv</code>