Re: TODO: Expose parser support for decoding unicode escape literals to user
От | Adrian Klaver |
---|---|
Тема | Re: TODO: Expose parser support for decoding unicode escape literals to user |
Дата | |
Msg-id | 5374C77D.7000003@aklaver.com обсуждение исходный текст |
Ответ на | TODO: Expose parser support for decoding unicode escape literals to user (Craig Ringer <craig@2ndquadrant.com>) |
Ответы |
Re: TODO: Expose parser support for decoding unicode escape
literals to user
Re: TODO: Expose parser support for decoding unicode escape literals to user |
Список | pgsql-general |
On 05/15/2014 01:31 AM, Craig Ringer wrote: > Hi all > > I just noticed a Stack Overflow question > (http://stackoverflow.com/q/20124393/398670) where someone's asking how > to decode '\u0000` style escapes *stored in database text fields* into > properly encoded text strings. > > The parser supports this for escape-strings, and you can write E'\u011B' > to get 'ě' because of > http://postgresql.1045698.n5.nabble.com/Unicode-escapes-in-literals-td1992313.html. > > I don't see this exposed in a way that users can call directly, though. > 'decode(bytea, text)' has the 'escape' input, but it expects octal. > > It's possible to use PL/PgSQL's 'EXECUTE' to use the parser to do the > work, but that's downright awful. > > Am I missing something obvious, or is this something that'd be a good > new-developer TODO? > Not sure if this is what you want?: test=> SELECT quote_literal(E'test \u011B'); quote_literal --------------- 'test ě' -- Adrian Klaver adrian.klaver@aklaver.com
В списке pgsql-general по дате отправления: