prahack / chat_bubbles

Flutter chat bubble/speech bubble widgets.
https://pub.dev/packages/chat_bubbles
MIT License
88 stars 72 forks source link

Issue displaying: Spanish accented characters #24

Open mycloudvip opened 1 year ago

mycloudvip commented 1 year ago

please see attached image:

Question: Is there a way to set UTF-8 for all rendered text from ChatGPT?

Thanks

IMG_3685

JohnF17 commented 1 year ago

Hey @mycloudvip ,The two things that come to my mind is

  1. Font Support: Ensure that the font you're using for your text supports the Spanish accented characters. Some fonts might not include all the necessary characters. You might want to use a font that is known to support a wide range of characters. and
  2. Locale and Encoding: Flutter automatically handles the locale and encoding of text. However, you can make sure that your app's locale is set correctly by using the MaterialApp's locale property. For Spanish, you can use const Locale('es', 'ES').

MaterialApp(
  locale: const Locale('es', 'ES'), // or just add the locale to the availableLocales list in the MaterialApp
  // ... other properties
)

I personally don't think this is the package's issue (As its very basic flutter code inside), so after you make sure you have done checked the 2 requirements above and those don't work i want you to confirm if the characters are rendered well on all screens, try debugPrint(theMessage) and check if it prints the message on the debug console correct or not.

If it does print well then i suggest you try providing a textstyle to the bubble widget OR wrapping the bubbleWidget in a DefaultTextStyle Widget and provide a textstyle and if it doesn't well then you know where the errors are comming from. Cheers! ✌️