collation

how to search for exact string in mysql

自古美人都是妖i 提交于 2020-01-09 09:24:12
问题 I'm trying to search for an exact match of a string in mysql. The string is 'nrew'. But when I do the queries below, I still get a result: SELECT UserID FROM sys_users WHERE UserID='NREW' SELECT UserID FROM sys_users WHERE UserID='NrEw' Please help. 回答1: SELECT UserID FROM sys_users WHERE BINARY UserID='NREW' 回答2: The default collation which MySQL uses to make comparisons is case insensitive. You need to specify a case sensitive collation or binary. You can either do this when creating the

Export import of asian languages data in sql server

你。 提交于 2020-01-06 01:59:10
问题 I am using BCP to import and export data, but some of it is in an asian language (think chinese or korean). It is stored correctly in the SQL, at least that's what I see from SSMS, though the collation is Latin1. However, when using BCP the export doesn't output the data in the right language anymore. I used the options -w and -N but neither worked. 来源: https://stackoverflow.com/questions/8361644/export-import-of-asian-languages-data-in-sql-server

How do I compare characters in custom sqlite collation in objective-c?

三世轮回 提交于 2020-01-05 08:16:37
问题 I went through lots of questions here on SO (like this one) but I still need some assistance. I need my sqlite select to order by slovenian alphabet (letter č comes after c, letter š after s and letter ž after z). Here is the code I use: static int sqlite3SloCollate(void * foo, int ll, const void *l, int rl, const void *r){ NSString *left = [NSString stringWithCharacters:l length:ll]; NSString *right = [NSString stringWithCharacters:r length:rl]; //THIS IS WHERE I DON'T KNOW HOW TO COMPARE

What MySQL collation/character set should I use for English and Spanish?

余生长醉 提交于 2020-01-05 07:49:09
问题 I'm building an PHP5 application with MySQL for English and Spanish speaking. Should I set the character set and collation to UTF8 and then convert everything into the database with mbstring? Or, should I use some kind of latin character set that supports both English and Spanish? The application is strictly US only and it doesn't need to support the full international range of languages. I'm using CodeIgniter on most projects. I just noticed the CI Database settings. $db['default']['char_set

query collation on foreign language field in Latin table

十年热恋 提交于 2020-01-05 07:23:33
问题 I have a series of tables that each have a dedicated column to a foreign language. Languages vary from Japanese, Thai, English, Italian, French, more than 20 in all. All of these tables are set up with Latin Case Insensitive collation. DB works fine. But now I am trying to query against the specific foreign language column of each table. Lets take Japanese for starters. I'd like a foreign language user to enter foreign text and find the record based on the foreign language column. DECLARE

MySQL select with different collation

非 Y 不嫁゛ 提交于 2020-01-05 06:45:12
问题 MySQL5.5 As I understand, collations are sets of rules to sort and compare strings, they allow for example to consider 'Mane' the same as 'Manè' . To me a collation makes sense only in the context of a comparison of two text strings. I have a table with latin1 charset and latin1_swedish_ci collation CREATE TABLE `swedish` ( `c` char(10) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 engine, charset and collation are given constraints. insert into swedish values ('Bar'), ('Bär'), ('Ber'),

Why do i have to use set_charset(“utf8”) even though everything is utf-8 encoded? (MySQLi-PHP)

非 Y 不嫁゛ 提交于 2020-01-04 01:53:22
问题 My table's collation is utf8_general_ci. My pages are encoded with UTF-8 (without BOM). Within my pages, my Equiv meta tag sets character set to utf8 My data has Turkish characters in it. When i output them, it's not showing them as it should be but when i do $db->set_charset("utf8"); , it works. Why do i have to use $db->set_charset("utf8"); even though everything is utf-8 encoded? 回答1: The data is stored as UTF-8 in MySQL, but the PHP's client connection collation is not. Which is why you

How to choose collation of SQL Server database

喜夏-厌秋 提交于 2020-01-03 07:31:12
问题 What if I want to use database to store different groups of special characters, how do I choose which collation to use? For example, if I set collation to Croatian and want to use Russian cyrillic, japanese characters except croatian special characters - which collation should I use? Thanks, Ilija 回答1: You'd use nvarchar to store the data COLLATION defines sorting and comparing That means you can store Croatian, Russian and Japanese in the same column. But when you want to compare ( WHERE

Firebird Database does not recognize unicode/cyrillic letters

前提是你 提交于 2020-01-02 23:04:56
问题 I really need someone's help with the encoding issue when trying to query Firebird tables. I am connecting to a firebird database using Firebird Maestro: The problem is that whenever I include Cyrillic letters in SQL Queries Firebird does not 'understand' them correctly. For instance, consider a query with some cyrillic letters: SELECT * FROM ROYALTY WHERE ROYALTY.PRIM = 'Кириллица' It does not return any values even though there is a row that contains 'Кириллица' value in a PRIM row. However

Firebird Database does not recognize unicode/cyrillic letters

心不动则不痛 提交于 2020-01-02 23:04:23
问题 I really need someone's help with the encoding issue when trying to query Firebird tables. I am connecting to a firebird database using Firebird Maestro: The problem is that whenever I include Cyrillic letters in SQL Queries Firebird does not 'understand' them correctly. For instance, consider a query with some cyrillic letters: SELECT * FROM ROYALTY WHERE ROYALTY.PRIM = 'Кириллица' It does not return any values even though there is a row that contains 'Кириллица' value in a PRIM row. However