samchon / typia

Super-fast/easy runtime validators and serializers via transformation
https://typia.io/
MIT License
4.55k stars 157 forks source link

invalid decode with valid utf8 emojis in protobuf #1306

Closed yovanoc closed 4 days ago

yovanoc commented 2 weeks ago

Bug Report

📝 Summary

Write a short summary of the bug in here.

Write detailed description in here.

⏯ Playground Link

https://typia.io/playground/?script=JYWwDg9gTgLgBDAnmYBDANHA3g1BzAZzgF84AzKCEOAIiRVRoG4AoOF4AOxgFMozUAYx5wAkgBUeBeFjYIpMAFxxpULnlbE2LemgB0YSjAgAjAK5k9IKQXw8APBIUA+ABQBKVi0ERO0uDycPgAmPMFwALwIyPqGEMbmloEhDk7SbrJw8tLKAORcAG6oADbA4aEpcADuwDAAFnBFpeFmMGQAHAEgEABWwESAfBuAR3u5LMSeLN6+-hUQoeFRuqgGRqYWerOhjpLprslzYRNTfhDFPHrFEHium4csQA

💻 Code occuring the bug

import typia, { tags } from "typia";

interface ITest {
  test: string;
}

typia.protobuf.message<ITest>();

const encoded = typia.protobuf.encode<ITest>({
  test: 'invalid decode with valid utf8 emojis 🫢'
});

const decoded = typia.protobuf.decode<ITest>(encoded);

console.log(decoded)
[LOG]: {
    test: "invalid decode with valid utf8 emojis 🫢\u0000\u0000"
  }
samchon commented 4 days ago

Upgrade to v6.11.2, then be fixed.