I am trying to show Unicode character ‘u0089’ in the snowflake browser results, however it seems to be showing a default error value instead. I’m lost as to how to fix this issue
The data is being ingested from a source JSON doc which states the field to be
"Units": "u0089"
As you can see, "Units": "u0089"
is not displaying correctly as ‰
One thing that is strange, is when removing the char()
method. I’ve tried another code 137
, however when trying to covert back as a unicode it is incorrect
Any ideas? Thanks!
Advertisement
Answer
Looking at Mark’s comment – you can do this with a Java UDF:
create or replace function encode_decode_windows(s string) returns string language java handler='MyClass.doit' as $$ class MyClass { public static String doit(String s) throws Exception { return new String(s.getBytes("ISO-8859-1"), "Windows-1252"); } } $$;
Then to encode and decode to get a mile sign:
select encode_decode_windows('u0089'); ‰