Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unicode is not rendered correctly #49

Open
felangel opened this issue Dec 4, 2020 · 5 comments
Open

Unicode is not rendered correctly #49

felangel opened this issue Dec 4, 2020 · 5 comments

Comments

@felangel
Copy link

felangel commented Dec 4, 2020

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
Copy link
Author

felangel commented Feb 4, 2021

@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! 🙏

@xxgreg
Copy link
Owner

xxgreg commented Feb 4, 2021

Pinged you privately with a possible solution.

@mtwichel
Copy link

@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! 🙏

@felangel
Copy link
Author

@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 👍

@mzdm
Copy link

mzdm commented Mar 8, 2021

@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 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants