0

The following query, executed against an old MySQL database, should reveal a single UTF-8 character 'yama' for mountain.

select convert(sc_cardname using binary) as cn
  from mtg.mtg_cdb_set_cards where setcardid = 214400

Instead it yields the following 15 byte array:

[195, 165, 194, 177, 194, 177, 195, 168, 226, 128, 158, 226, 128, 176, 32]

What are these values and how do I get from there to a character identity?

For reference, the expected binary aray would be the following:

[229, 177, 177]

Update: the following code fixes the yama problem, but I don't know why:

var iconv = new Iconv('utf8','ISO-8859-1');
shortBuffer = buffer.slice(0,-9);
result = iconv.convert(shortBuffer).toString('utf8');
lostinplace
  • 1,538
  • 3
  • 14
  • 38

1 Answers1

0

The answer was this, everything was actually encoded in LATIN1... changing the connection properties to reflect that solved the problem

lostinplace
  • 1,538
  • 3
  • 14
  • 38