Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
11
Erster Beitrag:
vor 4 Monaten, 2 Wochen
Letzter Beitrag:
vor 4 Monaten, 1 Woche
Beteiligte Autoren:
André Labuschagné, AndyD, L Jack Wilson, kingdr, Fabrice Harari

WDM21 - Android Push Notifications And UTF8

Startbeitrag von André Labuschagné am 27.07.2017 19:51

Hi All

I have been wasting a considerable amount of time with this now. I have established that Android needs the title and message to be passed as Unicode. I have tried absolutely everything and a character such as ">" always displays as "\x3E". If anyone has managed to get this to work I would very much appreciate a helping hand with it. I have a string with the character ">" in it. What must I do to this string to get Android to display the ">" correctly?

Cheers
André

Antworten:

Hi André,

I would say that, as usual, you must show us the code in question so that we have a chance at finding the problem.

Best regards

von Fabrice Harari - am 27.07.2017 20:09
Hi Fabrice

MyString is string = "This is a > test"

myNotif..Title = AnsiToUnicode(MyString,charsetAnsi) // does not work

myNotif..Title = StringToUTF8(MyString) // does not work

The ">" will always display as \x3E.

I can even assign is as follows:

myNotif..Title = "This is a > test"

And it does not work.

Cheers
André

von André Labuschagné - am 27.07.2017 20:52
Andre

Try to tick/chk box "Use Unicode strings at run time" >
Project description configuration tab >Unicode to see if it works.

HTH

King

von kingdr - am 27.07.2017 23:56
Hi King

Thanks - tried that but it did not work - same result. I am actually quite gobsmacked that no one has picked this up yet. I wonder if there is anyone on this forum who has done push notifications for Android and is seeing what I am seeing. This looks unresolvable - unless I am missing something obvious.

At this juncture it is a show stopper.

Cheers
André

von André Labuschagné - am 28.07.2017 06:43
Have you tried URLEncode/URLDecode?

https://doc.windev.com/?3024040&verdisp=220

Idea from:
https://stackoverflow.com/questions/11501504/android-gcm-unicode-charcters-are-not-received

...jack

von L Jack Wilson - am 28.07.2017 15:13
Thanks Jack - sadly that did not work. What keeps blowing my mind is that no one has seemingly noticed this.

Am I the only one using push notifications with Android and have noticed this? And if I am not and other folk do pass ">" to a notification title or message and they see the ">" on the phone what is the code to do that?

The mind boggles.

von André Labuschagné - am 29.07.2017 10:53
Try html encoding, maybe that works.

von AndyD - am 29.07.2017 13:31
Hi Andy

Html unfortunately not applicable in this instance.

Cheers
André

von André Labuschagné - am 30.07.2017 16:15
Update on character > and < displaying Unicode equivalent syntax in Android. Checked every other ASCII character and many extended ones as well. They all work except these two. I have given up for now and automatically convert these characters is used to extended character equivalents. Not ideal but there is nothing else I can do. Will issue a cautionary while we wait for any ideas from Montpelier. Just wondering how many other funnies are lurking under the push notification hood. In the case of Apple when these characters are used the push notification never gets delivered.

Cheers
André

von André Labuschagné - am 30.07.2017 16:21
Latest on this - PCSoft has acknowledged the problem with > and < and push notifications. They have sent if off to the developers and we may get a fix.

Cheers
André

von André Labuschagné - am 01.08.2017 21:29
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.