Re: Oracle encoding query
[email protected] ("H.Merijn Brand") Wed, 6 Dec 2017 16:53:36 +0100
| Newsgroups | perl.dbi.users |
|---|---|
| Message-ID | <[email protected]> |
On Wed, 6 Dec 2017 15:34:17 +0000, Tim Bunce <[email protected]> wrote: > On Wed, Dec 06, 2017 at 04:12:53PM +0100, H.Merijn Brand wrote: > > On Wed, 6 Dec 2017 15:50:11 +0100, "H.Merijn Brand" > > > > > > I have been playing with several variants of > > > > > > select convert (land_u, 'AL16UTF16', 'UTF8') from land where c_land = 7072; > > > > > > but I didn't get SQL Developer to show the ë > > > > select utl_encode.text_encode (land_u) from land where c_land = 7072; > > > > => > > > > Zuidrhodesi=C3=AB > > > > so SQL developer *does* see the individual bytes as they are stored > > > > I can get the expected display with > > > > select utl_i18n.raw_to_nchar (utl_i18n.string_to_raw (land_u), 'utf8') from land where c_land = 7072; > > > > which experiences as rather overcomplicated, esp if I need to do this > > for all _u fields in the query :( > > A view might be useful. Or perhaps define your own function to wrap the expression. > > Tim. That worked very well! CREATE OR REPLACE FUNCTION diac_u (v VARCHAR2) RETURN NCHAR IS BEGIN RETURN utl_i18n.raw_to_nchar (utl_i18n.string_to_raw (v), 'utf8'); END; / select diac_u (land_u) from land where c_land = 7072; ⇒ Zuidrhodesië Thank you! -- H.Merijn Brand http://tux.nl Perl Monger http://amsterdam.pm.org/ using perl5.00307 .. 5.27 porting perl5 on HP-UX, AIX, and openSUSE http://mirrors.develooper.com/hpux/ http://www.test-smoke.org/ http://qa.perl.org http://www.goldmark.org/jeff/stupid-disclaimers/
signature.asc
(application/pgp-signature, 473 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJaKBKLAAoJEAOhR6E+XcCY8jIIAKut485VRQkSJZebCHKAhGeY aZ5MszgvgDpJBHCYgidjANvJb99BIzilvoP4+ldUwvempneguXo2BmiVvY8jiyH+ /+MKoCiF2JqrpkazNHIn8D/EAloTgN5jyUC7ef6p0rqPWuN1lA5UeHewM8kKPDJI 1ZWyV6ph91b3Bu4xqh2WcglpWHpkIrbohlQ2HcMQ+dhVCzD6DLQQ6G9OcMJWN50m 93N4swoBK56wM6gnvdlRP64fH7dAD2XY2HgJZCW580vyO3byluNyNzC8KF2PZ9lR aaBd4HmfZI+1OJAqoEnVPTN/PnKfdJwl+jyaMFpw6Gy91whvNMyOy3oEgK38YXo= =rIyb -----END PGP SIGNATURE-----