mustache icon indicating copy to clipboard operation
mustache copied to clipboard

Unicode is not rendered correctly

Open felangel opened this issue 5 years ago • 5 comments

test('Unicode', () {
  var output = parse('\u{1F634}\n').renderString({});
  expect(output, equals('\u{1F634}\n'));
});

The above test fails with the following error:

Expected: '😴\n'
            ''
  Actual: '😴\n'
            '😴\n'
            ''
   Which: is different. Both strings start the same, but the actual value also has the following trailing characters: 😴\n

package:test_api              expect
test/mustache_test.dart 41:7  main.<fn>.<fn>

felangel avatar Dec 04 '20 03:12 felangel

@xxgreg @jonahwilliams this issue is a blocker for me. I believe I have a fix but this repo and https://github.com/jonahwilliams/mustache don't appear to be very active. I really don't want to fork and republish yet again so can either of you help get a fix for this merged and published? Thanks! 🙏

felangel avatar Feb 04 '21 16:02 felangel

Pinged you privately with a possible solution.

xxgreg avatar Feb 04 '21 20:02 xxgreg

@xxgreg @felangel I'm facing a similar issue I believe and wonder if a similar solution could help.

test('Less than', () {
    var output = Template('{{val}}').renderString({'val': '<'});

    expect(output, '<');
  });

fails with the error:

Output for Less than
Expected: '<'
  Actual: '&lt;'
   Which: is different.
          Expected: <
            Actual: &lt;
                    ^
           Differ at offset 0

package:test_api                                   expect
test/src/generators/dart_generator_test.dart 91:5  main.<fn>

Thanks! 🙏

mtwichel avatar Feb 12 '21 00:02 mtwichel

@mtwichel yeah I think it's the same root cause 👍 @xxgreg can you please add me as a publisher/contributor? I'd love to open a PR with a fix and publish a new release 👍

felangel avatar Feb 12 '21 03:02 felangel

@mtwichel yeah I think it's the same root cause 👍 @xxgreg can you please add me as a publisher/contributor? I'd love to open a PR with a fix and publish a new release 👍

would be great to push this along with null safety

@xxgreg @jonahwilliams this issue is a blocker for me. I believe I have a fix but this repo and https://github.com/jonahwilliams/mustache don't appear to be very active. I really don't want to fork and republish yet again so can either of you help get a fix for this merged and published? Thanks! 🙏

this one has at least null safety now 👍

mzdm avatar Mar 08 '21 11:03 mzdm