aboutsummaryrefslogtreecommitdiffstats
path: root/lib/LXRng/Index
diff options
context:
space:
mode:
Diffstat (limited to 'lib/LXRng/Index')
-rw-r--r--lib/LXRng/Index/DBI.pm16
-rw-r--r--lib/LXRng/Index/Pg.pm2
2 files changed, 17 insertions, 1 deletions
diff --git a/lib/LXRng/Index/DBI.pm b/lib/LXRng/Index/DBI.pm
index 763f534..55e215d 100644
--- a/lib/LXRng/Index/DBI.pm
+++ b/lib/LXRng/Index/DBI.pm
@@ -520,6 +520,22 @@ sub get_identifier_info {
\%reflines);
}
+sub set_rfile_charset {
+ my ($self, $rfile_id, $charset) = @_;
+
+ my $dbh = $self->dbh;
+ my $pre = $self->prefix;
+ my $sth = $$self{'sth'}{'set_rfile_charset'} ||=
+ $dbh->prepare(qq{
+ update ${pre}revisions
+ set body_charset = (select id from ${pre}charsets
+ where name = ?)
+ where id = ?});
+
+ return $sth->execute($charset, $rfile_id);
+}
+
+
sub get_rfile_timestamp {
my ($self, $rfile_id) = @_;
diff --git a/lib/LXRng/Index/Pg.pm b/lib/LXRng/Index/Pg.pm
index 3654a72..7387abc 100644
--- a/lib/LXRng/Index/Pg.pm
+++ b/lib/LXRng/Index/Pg.pm
@@ -67,7 +67,7 @@ sub init_db {
or die($dbh->errstr);
$dbh->do(qq{insert into ${pre}charsets(name) values ('utf-8')})
or die($dbh->errstr);
- $dbh->do(qq{insert into ${pre}charsets(name) values ('iso8859-1')})
+ $dbh->do(qq{insert into ${pre}charsets(name) values ('iso-8859-1')})
or die($dbh->errstr);
$dbh->do(qq{