Comments (7)
Effectively connection collation was wrong but still LuaDBI should allow
specifying a connection collation, in the Connection Object.
Original comment by [email protected]
on 21 Aug 2013 at 11:00
from luadbi.
Connection collation and other parameters are handled via SQL commands such as
'SET NAMES'. This is the standard way to do it.
Original comment by MWild1
on 21 Aug 2013 at 11:19
from luadbi.
Matthew, yes I know and did test that, but that produces no result the output
is still garbled.
I did run via LuaDBI:
SET collation_connection = utf8_general_ci;
SET collation_server = utf8_general_ci;
SET NAMES utf8;
but result is still garbled:
| name �екунд узнаем
| Result: nil
related session variables are _all_ set to use utf8:
| character_set_client utf8
| character_set_connection utf8
| character_set_database utf8
| character_set_filesystem binary
| character_set_results utf8
| character_set_server utf8
| character_set_system utf8
| character_sets_dir /usr/share/mysql/charsets/
| collation_connection utf8_general_ci
| collation_database utf8_general_ci
| collation_server utf8_general_ci
More then this I have no idea what else is needed to get clean UTF-8 output.
Original comment by [email protected]
on 22 Aug 2013 at 2:21
from luadbi.
How did you create your database,
Normally
CREATE DATABASE database_name DEFAULT CHARACTER SET utf8 DEFAULT COLLATE
utf8_general_ci;
should be enough.
Dont forget to create your tables with this at the end: create table ....
DEFAULT CHARSET=utf8
And instead of sending set names sql with every sql query, you can set it in
your mysql conf only once.
under [mysqld]
add these 2 rows:
character_set_server = utf8
collation_server = utf8_general_ci
That's all.
SkyBlue
Original comment by [email protected]
on 22 Aug 2013 at 11:35
from luadbi.
> More then this I have no idea what else is needed to get clean UTF-8 output.
Note that data put into the database with the wrong connection parameters will
be translated incorrectly by MySQL. So test again with new data, storing and
retrieving, with the new connection parameters.
Original comment by MWild1
on 22 Aug 2013 at 11:37
from luadbi.
SkyBlue, I didn't create it but the DB is created with the correct statements
and has utf8 charset and collation.
MattJ, that's it, perhaps I suppose the data in the db could have been inserted
with the wrong connection collation.
Original comment by [email protected]
on 22 Aug 2013 at 11:57
from luadbi.
Original comment by MWild1
on 30 Jul 2014 at 10:08
- Changed state: Invalid
from luadbi.
Related Issues (20)
- Trying to use on a Windows 7 Luarocks installation HOT 1
- Include for postgres_fe.h looks in non-standard location HOT 6
- Need to move to autoconf HOT 1
- Infinite loop when retrieving empty blobs (MySQL) HOT 3
- When a PostgreSQL connection is opened, a transaction is started before the previous transaction commits. HOT 5
- Problem compile HOT 3
- Problem compile HOT 1
- OSX binaries HOT 1
- fetch() on mysql returns expected output with trailing random characters HOT 5
- Empty values from joined tables HOT 3
- Makefile improvements (fixes for #11 and #12) HOT 2
- enum fields seems not correct in lua-dbi HOT 1
- Issue with compile.
- sqlite3 does not allow strings with NULL characters HOT 4
- luadbi with lua 5.2 HOT 7
- "SELECT 1" returns invalid type HOT 3
- Unchecked malloc in common.c HOT 2
- support unix socket in mysql driver HOT 2
- MySQL BIGINT handled wrong HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from luadbi.