======================================================================
 mb::JSON Cheat Sheet                                   [KM] ភាសាខ្មែរ
======================================================================

[ ការផ្គូផ្គងប្រភេទទិន្នន័យ ]
  JSON       -> Perl
  -----------------------------------------------
  "អត្ថបទ"  -> scalar string
  123        -> scalar លេខ
  true       -> mb::JSON::Boolean (តម្លៃ: 1)
  false      -> mb::JSON::Boolean (តម្លៃ: 0)
  null       -> undef
  [...]      -> array reference
  {...}      -> hash reference

[ 1. Load ]
  use mb::JSON;

[ 2. decode: JSON -> Perl ]
  my $data = mb::JSON::decode($json_text);

[ 3. parse: alias of decode() ]
  my $data = mb::JSON::parse($json_text);

[ 4. encode: Perl -> JSON ]
  my $json = mb::JSON::encode($data);

[ 5. stringify: Perl -> JSON  (JavaScript-compatible alias) ]
  my $json = mb::JSON::stringify($data);
  # stringify() និង encode() ផ្តល់លទ្ធផលដូចគ្នា

[ 6. Boolean ]
  mb::JSON::true  -> true
  mb::JSON::false -> false

[ 7. null / undef ]
  undef -> null  /  null -> undef

[ 8. សោ hash តម្រៀបតាមលំដាប់អក្សរ ]
  encode({b=>2,a=>1}) -> '{"a":1,"b":2}'

[ 9. UTF-8 នៅដដែល ]
  encode({"name"=>"田中"}) -> '{"name":"田中"}'
  decode: "\uXXXX"           -> UTF-8
  decode: "\uD83D\uDE00"     -> 4-byte UTF-8 (emoji)

[ 10. ឧទាហរណ៍ ]
  my $h = mb::JSON::decode('{"name":"Alice","ok":true}');
  my $j = mb::JSON::encode({name=>'Alice',ok=>mb::JSON::true});
  my $j = mb::JSON::stringify({name=>'Alice',ok=>mb::JSON::true});
  # -> {"name":"Alice","ok":true}
