When I use built-in drupal search with words containing character like "ěščřžýáíéúů" and so on I get error message:

domain.domain.tld/site

Error
The website encountered an unexpected error. Please try again later.

PDOException: SQLSTATE[IMSSP]: An error occurred translating string for input param 7 to UCS-2: No mapping for the Unicode character exists in the target multi-byte code page. in dblog_watchdog() (line 157 of C:\inetpub\web\Vyvoj\testdr\modules\dblog\dblog.module).
. 

It is big problem as all articles contain these characters. Any ideas how to solve this problem

Comments

mgifford’s picture

Might want to try looking here http://drupal.org/node/1292274#comment-5085412

Also, have you tried using http://drupal.org/project/transliteration

franc3sco’s picture

Is this still an issue or has it been resolved?
If it is resolved, how? I'm getting the same issue with SqlSrv.

chris.smith’s picture

Same issue here. Working to find resolution. Unfortunately transliteration doens't work on SQLSRV.

wellsys_world’s picture

Hi, I've got the same problem.

Has anyone found a solution?

Thanks

diehard6996’s picture

I had this issue for some months now (http://drupal.org/node/1540686) and finally solved it. Copying my solution below. It would be good if someone could turn this into a .patch for anyone using sqlsrv, or even implement it in some next version of Drupal 7.

You just have to add few lines of code at two specific drupal distribution files. This works for Drupal 7 for sure.

First the file modules\dblog\dblog.module, go to function dblog_watchdog(array $log_entry) and add the following lines right at the beginning (in Drupal 7.15 this is line 140):

  if (!mb_detect_encoding($log_entry['message'], 'UTF-8', true))
          $log_entry['message'] = mb_convert_encoding($log_entry['message'], 'UTF-8', 'ISO-8859-1');
  if (!mb_detect_encoding($log_entry['request_uri'], 'UTF-8', true))
          $log_entry['request_uri'] = mb_convert_encoding($log_entry['request_uri'], 'UTF-8', 'ISO-8859-1');
  if (!mb_detect_encoding($log_entry['referer'], 'UTF-8', true))
          $log_entry['referer'] = mb_convert_encoding($log_entry['referer'], 'UTF-8', 'ISO-8859-1');

Then at file includes\bootstrap.inc, function check_plain($text) which at Drupal 7.15 is at line 1571 add the following lines right at the beginning again:

    if (!mb_detect_encoding($text, 'UTF-8', true))
        $text = mb_convert_encoding($text, 'UTF-8', 'ISO-8859-1');

Many credits to Robert Johnson at http://social.msdn.microsoft.com/Forums/en-US/sqldriverforphp/thread/6a1...

rob_johnston’s picture

Status: Active » Needs review
StatusFileSize
new1.44 KB

Here's a patch that includes the changes from #5.

geigerg’s picture

Priority: Major » Critical
geigerg’s picture

Version: 7.x-1.1 » 7.x-1.2

Tested against 7.x-1.2 - works so far.

damien tournoud’s picture

Priority: Critical » Normal
Status: Needs review » Closed (works as designed)

This is a IIS issue. You will have to set a registry entry to fix it.

Please see http://support.microsoft.com/kb/2277918

rob_johnston’s picture

Status: Closed (works as designed) » Needs work

That link only provides a hotfix for IIS 7.5 for Windows7/WIndows Server 2008 R2. I've got IIS6 running on Windows 2003 SP2, so a patch is required. Anybody got a way to do an if-else based on that?

geigerg’s picture

Is there a fix for win 2012 iis8? Adding the key wont work.

IIS 8 works fine - after Setting the correct values in registry. -> value1 -enter- value2

damien tournoud’s picture

Category: bug » support
Status: Needs work » Fixed

I'm going to mark this as closed, as this is not actually an issue with the SQL Server driver.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.