0

I need to convert VARCHAR2 columns that store text in unkown character sets into a standard UTF-8 BLOB.

The table has more columns, but the ones of interest to me are:

ADDRESS     POST
----------  --------------
gibberish1  gibberish2
gibberish3  gibberish4

The "gibberish" is actually good content. It's just I can't determine the specific character set. I assume the engine knows it internally.

If an ideal UTF8() function existed my query could concatenate the whole thing doing:

SELECT RAWTOHEX(UTF8(ADDRESS)) || ',' || RAWTOHEX(UTF8(POST)) FROM TAB1;

Is there any function that can convert to UTF8 without knowing the existing encoding?

7
  • So, not quite sure what those two columns could contain... Greek character set, Japanese? And you want to end up with a Binary Large Object? Please edit and clarify. Commented Oct 27, 2021 at 18:01
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.
    – Community Bot
    Commented Oct 27, 2021 at 18:01
  • What's the current character set? Is DB expected to support other languages? Commented Oct 27, 2021 at 18:06
  • My bad, I meant UTF-8 instead of Unicode. Commented Oct 27, 2021 at 18:07
  • 2
    "I assume the engine knows it internally" -- your assumption is wrong. The data might appear as "gibberish" to you if you incorrectly configure your client NLS settings.
    – mustaccio
    Commented Oct 27, 2021 at 18:23

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.