mirror of
https://github.com/postgres/postgres.git
synced 2025-04-22 23:02:54 +03:00
Fix a bug in psql. unescape() does not work for multi-byte encodings.
This commit is contained in:
parent
4571439297
commit
2bc2738fc4
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* Copyright 2000 by PostgreSQL Global Development Group
|
* Copyright 2000 by PostgreSQL Global Development Group
|
||||||
*
|
*
|
||||||
* $Header: /cvsroot/pgsql/src/bin/psql/command.c,v 1.46 2001/02/10 02:31:27 tgl Exp $
|
* $Header: /cvsroot/pgsql/src/bin/psql/command.c,v 1.47 2001/02/17 10:03:33 ishii Exp $
|
||||||
*/
|
*/
|
||||||
#include "postgres_fe.h"
|
#include "postgres_fe.h"
|
||||||
#include "command.h"
|
#include "command.h"
|
||||||
@ -1166,7 +1166,13 @@ unescape(const unsigned char *source, size_t len)
|
|||||||
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
*tmp++ = *p;
|
int i;
|
||||||
|
const unsigned char *mp = p;
|
||||||
|
|
||||||
|
for (i = 0;i < PQmblen(p, pset.encoding);i++)
|
||||||
|
{
|
||||||
|
*tmp++ = *mp++;
|
||||||
|
}
|
||||||
esc = false;
|
esc = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user