mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-22 17:23:03 +01:00
CORE-2929 - 'Invalid ESCAPE sequence' when connecting to the database
This commit is contained in:
parent
bb0ca45669
commit
7a110f4be0
@ -31,16 +31,6 @@ may automatically convert the filename and insert the DPB. Clients older than v2
|
|||||||
so the received filenames are going to be considered as on the server codepage. We again guarantee
|
so the received filenames are going to be considered as on the server codepage. We again guarantee
|
||||||
backward compatibility when client and server codepage are the same.
|
backward compatibility when client and server codepage are the same.
|
||||||
|
|
||||||
The OS codepage and UTF-8 may not be the better choice for filenames. For example, if you had a
|
|
||||||
ISQL (or some other tool) script and that script uses another connection charset. You could not
|
|
||||||
correctly edit a script (or any file) using multiple character sets (codepages). So you may now
|
|
||||||
encode any Unicode character as ASCII characters on the connection string filename. That's
|
|
||||||
accomplished using the symbol #. It is a prefix for an Unicode code point number (in hexadecimal
|
|
||||||
format, like U+XXXX notation). You should write it in this way: #XXXX with X being 0-9, a-f, A-F.
|
|
||||||
If you want to use the literal #, you could use ## or #0023 (the code point number for it).
|
|
||||||
That character is interpreted with this new semantics at the server even if the client is older
|
|
||||||
than v2.5.
|
|
||||||
|
|
||||||
The OS codepage used for conversions is:
|
The OS codepage used for conversions is:
|
||||||
- Windows: The Windows ANSI code page
|
- Windows: The Windows ANSI code page
|
||||||
- Others: UTF-8
|
- Others: UTF-8
|
||||||
|
@ -1696,12 +1696,14 @@ void ISC_utf8ToSystem(Firebird::AbstractString& str)
|
|||||||
// Escape Unicode characters from a string
|
// Escape Unicode characters from a string
|
||||||
void ISC_escape(AbstractString& str)
|
void ISC_escape(AbstractString& str)
|
||||||
{
|
{
|
||||||
|
#if 0 // CORE-2929
|
||||||
size_t pos = 0;
|
size_t pos = 0;
|
||||||
while ((pos = str.find_first_of("#", pos)) != npos)
|
while ((pos = str.find_first_of("#", pos)) != npos)
|
||||||
{
|
{
|
||||||
str.insert(pos, "#");
|
str.insert(pos, "#");
|
||||||
pos += 2;
|
pos += 2;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1736,6 +1738,7 @@ static inline void FB_U8_APPEND_UNSAFE(char* s, int& i, const int c)
|
|||||||
// Unescape Unicode characters from a string
|
// Unescape Unicode characters from a string
|
||||||
void ISC_unescape(AbstractString& str)
|
void ISC_unescape(AbstractString& str)
|
||||||
{
|
{
|
||||||
|
#if 0 // CORE-2929
|
||||||
size_t pos = 0;
|
size_t pos = 0;
|
||||||
while ((pos = str.find_first_of("#", pos)) != npos)
|
while ((pos = str.find_first_of("#", pos)) != npos)
|
||||||
{
|
{
|
||||||
@ -1764,4 +1767,5 @@ void ISC_unescape(AbstractString& str)
|
|||||||
else
|
else
|
||||||
status_exception::raise(Arg::Gds(isc_bad_conn_str) << Arg::Gds(isc_escape_invalid));
|
status_exception::raise(Arg::Gds(isc_bad_conn_str) << Arg::Gds(isc_escape_invalid));
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user