MySQL encoding error: Warning (Code 1366): Incorrect string value: '\xE9, a <...' for column 'body' at row 3

Submitted by Druss on Sun, 2013-06-02 13:10

While performing a CSV import recently, I ran into the following error messages:

Warning (Code 1366): Incorrect string value: '\xE9, a <...' for column 'body' at row 3
Warning (Code 1366): Incorrect string value: '\xE6. He ...' for column 'body' at row 24
Warning (Code 1366): Incorrect string value: '\xE9, and...' for column 'body' at row 26

The first message was triggered due to the accented é in the word, protegé, in the input. The rest of the field was not imported. The others were similarly triggered.

Changing a file's encoding using Vim

Submitted by Druss on Sun, 2013-06-02 13:07

During imports and stuff, it's imperative that all steps utilise the same encoding/character set. If a text file is not using the preferred encoding, we can use Vim to change it during its save action as follows:

:set fileencoding=utf8
:w

or if you want to save it to a different file and leave the current file unchanged:

:w ++enc=utf-8 newfile.txt

Vim does not respect certain regex character classes during substitutions

Submitted by Druss on Sat, 2013-06-01 07:48

Just now while attempting to perform a substitution in GVim, I found that the regex was not working as expected. Apparently, instead of matching all non-whitespace characters denoted by the shorthand class \S, the engine was matching the letter S instead, which was odd. It turns out that, as usual, I was the one at fault. What I was doing wrong was attempting to use the character class within [] groups.

Vim runs out of memory during a find and replace

Submitted by Druss on Sun, 2013-05-26 07:59

Earlier today, I had to perform a substitution in Gvim within a 2GB file. Unfortunately, after a few thousand operations, Vim ran out of memory with the following error:

  Out of memory!
Out of memory!  (allocating XXX bytes)

Windows too complained about running out of virtual memory and my system slowed down to treacle-like response times.

What is a female guru called?

Submitted by Druss on Thu, 2013-05-16 11:28

According to a handy Sanskrit dictionary from the library, the female equivalent of a guru (गुरु) is a gurvi (गुर्वी). This is confirmed to an extent in a couple of places. It is also interesting to note that guru literally means grave or weighty and is cognate with the English word grave.

Upgrading KTorrent in Kubuntu Precise

Submitted by Druss on Tue, 2013-05-14 12:24

KTorrent on the LTS release of Kubuntu—Precise Pangolin aka 12.04—is perfectly fine except for the fact that it comes only with version 4.1. Unfortunately, this package is missing a few features that I was looking for, especially the option to add magnet links via its web interface.

Upgrading from 4.1 to 4.3 (the latest version at the time of writing) is pretty straightforward if one is happy to accept PPA sources.

PDOException: SQLSTATE[HY000]: General error: 144 Table 'cache_menu' is marked as crashed and last (automatic?) repair failed: DELETE FROM {cache_menu};

Submitted by Druss on Tue, 2013-04-23 10:38

While trying to edit a menu on a Drupal site, I found that none of my changes were being saved. Looking at the logs led me to the following error message:

PDOException: SQLSTATE[HY000]: General error: 144 Table 'cache_menu' is marked as crashed and last (automatic?) repair failed: DELETE FROM {cache_menu};

Simply restarting MySQL did not fix things and it looked like I had to get my hands a li'l dirty.

Class 'MollomDrupal' not found

Submitted by Druss on Tue, 2013-04-23 10:15

I upgraded the Mollom module on this site from the 7.1.x version to the newer branch of 7.2.x and ran into a White Screen of Death (WSOD). Checking the logs pointed me to the Mollom error:

Class 'MollomDrupal' not found

It's tough to fix this as you might not be able to even log into the site to get to the admin page. Therefore, you will need to disable the module from the database.

Pages

Subscribe to languor.us RSS