Kaju Textencoding issue

I noticed Kaju, when Admin app is run on macOS, will display the update information correctly on macOS too, but on Windows, any special character is garbled.
@Kem_Tekinay or other users: Any hint on how to fix this issue?

macOS:

Windows:
NuEkFnckyXn0NySM

It look like an encoding issue. Where are you getting the data from? If it is from a database are you using DefineEncoding on the source string and then ConvertEncoding if appropriate?

macOS uses UTF8 as standard, perhaps windows is requiring some other encoding in the text field you are using to display the result?

Xojo on Windows operates using UTF8 as usual, but most API calls direct to the OS (as those using declares) must be converted to/from UTF16, and always using the API “Wide” (UTF16) calls (Call_W() and never using legacy Call_A()). Maybe something is broken on how things are conducted in Kaju for Windows (or Ulrich’s code, don’t know). If receiving stream from unknown sources, probably its encoding is Nil and must be set as UTF8 with DefineEncoding and that by itself solves many cases.

Thank you! I implemented a quick fix in my build that will convert the text being shown to Windows Latin1 on Win machines. This seems to work for now.
EDIT: UTF8 did not work in my tests.

1 Like

Inspect the raw string received, determine what you are receiving observing it.

image

Is the HTMLViewer using Native or WebKit rendering? That might account for the difference.

The safest thing to do is to replace your punctuation with HTML entity codes.

1 Like

Oh, HTMLViewer issue? Maybe you need to fix your header defining the encoding of the text.

I can simulate your problem forcing the wrong encoding:

An fix it, forcing the correct one <meta charset="UTF-8">

There is certainly an issue with HTMLViewer and HTML5 files that don’t declare a charset. The HTML5 standard says that the view should assume UTF8 as standard, however, the Xojo HTMLViewer doesn’t do this unless you include the tag. Please sign-on if it is affecting you.
https://tracker.xojo.com/xojoinc/xojo/-/issues/64259