in reply to Re^2: Encoding of emoji character
in thread Encoding of emoji character
That "wide character" might be not the smilie, but one (actually, three) of the bytes it is encoded with.
"F0.9F.98.80" is what sprintf( "%vX", $text) would output for e.g. $text = "\N{LATIN SMALL LETTER ETH}\x9F\x98\x80";
but for $text = "\N{GRINNING FACE}" it should instead show "1F600".
b) You could feed "Test \N{GRINNING FACE}" to your test program (for Perl older than 5.16, you need an explicit use charnames; for the \N escape to work).{ use charnames ':full'; use feature 'say'; for my $c ( split //, $text ) { say Dumper $c, ord $c, charnames::viacode( ord $c ); } }
I suspect that your console output accidentally uses the same (wrong) encoding as the database input, so it looks right…
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Encoding of emoji character
by choroba (Cardinal) on Jun 20, 2022 at 13:04 UTC | |
|
Re^4: Encoding of emoji character
by dcunningham (Sexton) on Jun 20, 2022 at 21:27 UTC | |
by soonix (Chancellor) on Jun 21, 2022 at 18:47 UTC | |
by dcunningham (Sexton) on Jun 22, 2022 at 03:37 UTC | |
by Anonymous Monk on Jun 21, 2022 at 06:09 UTC | |
by soonix (Chancellor) on Jun 21, 2022 at 18:52 UTC | |
by dcunningham (Sexton) on Jun 22, 2022 at 03:40 UTC |