FoxPro Programming
Latin Characteres
Gravatar is a globally recognized avatar based on your email address. Latin Characteres
  Juan Ramón Aguilar
  All
  Aug 25, 2021 @ 08:40pm

Hi.

I am testing the wwHTTP class, and when I send a post with characteres like ñ, á, é, í, ó, ú; my API gets something like !¿1/2 for each one; so, I need to know if there is a way to send those characteres. I tested write a '' before the character, but it did not work.

Regards!

Gravatar is a globally recognized avatar based on your email address. re: Latin Characteres
  FoxInCloud Support - Thierry N.
  Juan Ramón Aguilar
  Aug 26, 2021 @ 05:22am

try

oHTTP = create('wwHTTP')
…
oHTTP.addHeader('content-encoding', 'UTF-8')
…
oHTTP.addPostKey('someKey', strConv('ñ, á, é, í, ó, ú', 9))
…
Gravatar is a globally recognized avatar based on your email address. re: Latin Characteres
  Juan Ramón Aguilar
  FoxInCloud Support - Thierry N.
  Aug 26, 2021 @ 07:40am

Hi Rick.

Thanks for your answer.

I confirm that the strConv('ñ, á, é, í, ó, ú', 9) was enough.

Thank you again.

Gravatar is a globally recognized avatar based on your email address. re: Latin Characteres
  FoxInCloud Support - Thierry N.
  Juan Ramón Aguilar
  Aug 26, 2021 @ 08:49am

I'm Thierry Nivelet from FoxInCloud

Gravatar is a globally recognized avatar based on your email address. re: Latin Characteres
  Juan Ramón Aguilar
  FoxInCloud Support - Thierry N.
  Aug 26, 2021 @ 08:56am

I am so sorry Thierry. I got confused by the photo from automated email, Rick is all around jajajaja.

Thanks again for your time.

Gravatar is a globally recognized avatar based on your email address. re: Latin Characteres
  Rick Strahl
  FoxInCloud Support - Thierry N.
  Aug 26, 2021 @ 01:13pm

While that will work and can be a good idea, that should also not be necessary.

Try this:

DO wwHttp

loHttp = CREATEOBJECT("wwHttp")
loHTTP.addPostKey('FirstName', strConv('ñ, á, é, í, ó, ú', 9))
ShowHtml( loHttp.Post("https://west-wind.com/wconnect/testpage.wwd") )

and scroll to the bottom of the page where the post variables are echo'd back. You should see the value displayed as is:

Raw characters and no special encoding should work as long as your code page supports those characters.

You need UTF-8 encoding if you're using extended characters that don't exist in other character sets (like Emoji's or Asian or Cyrillic characters etc.). It's not a bad idea to UTF-8 encode to make sure there's no ambiguity but Web servers will receive the text as UTF-8 or unicode and work with either. As long as FoxPro can generate the correct string it will work in the POST data.

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: Latin Characteres
  FoxInCloud Support - Thierry N.
  Rick Strahl
  Aug 27, 2021 @ 12:28am

Rick,

Please note that the e-mails I receive from the message board have this header:

X-GND-Status: PHISHING

and thus go directly into my Thunderbird spam folder.

FWIW, here is the complete message header (encoded '@' to avoid e-mail address fishing):

Return-Path: <bounce+22b225.da0bac-thn=foxincloud.com…(at)…west-wind.com>
Delivered-To: tnivelet…(at)…foxincloud.com
Received: from spool.mail.gandi.net (spool1.mail.gandi.net [217.70.178.210])
	by nmboxes62.sd4.0x35.net (Postfix) with ESMTPS id A02A82038F
	for <tnivelet…(at)…foxincloud.com>; Thu, 26 Aug 2021 20:13:30 +0000 (UTC)
Received: from so254-27.mailgun.net (so254-27.mailgun.net [198.61.254.27])
	by spool.mail.gandi.net (Postfix) with ESMTPS id 9A4F0941A71
	for <thn…(at)…foxincloud.com>; Thu, 26 Aug 2021 20:13:29 +0000 (UTC)
DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=west-wind.com; q=dns/txt;
 s=smtp; t=1630008809; h=Content-Transfer-Encoding: Content-Type:
 Subject: Date: Reply-To: To: From: MIME-Version: Message-Id: Sender;
 bh=o0kX5a77eEzWk6iW0qoCYK3tz+4WgotIX1FMhEBujsI=; b=wtXJ6FOkXQXfTrolEy41vtqUvlwOTr4mES/ElWw3xjLeUAC03FCJiRo6NzOVHVMafv22xcYO
 +StCfwRuN+61pbYxnuLo4x0aSV4ocYbQO345FJhJplJB3cdE+VGGQXZkjGaz3bkvjvfi4XtV
 nUaX/8KukHpiWJ1k7wosf8n9GYU=
X-Mailgun-Sending-Ip: 198.61.254.27
X-Mailgun-Sid: WyJkOTIyOSIsICJ0aG5AZm94aW5jbG91ZC5jb20iLCAiZGEwYmFjIl0=
Received: from WESTWINDSERVER (45.32.228.159.vultr.com [45.32.228.159]) by
 smtp-out-n07.prod.us-west-2.postgun.com with SMTP id
 6127f5e8096d475c7c9eeba9 (version=TLS1.2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Thu, 26 Aug 2021 20:13:28
 GMT
Sender: support…(at)…west-wind.com
Message-Id: <20210826201328.71f5fcdc75c296e1…(at)…west-wind.com>
x-mailer: West Wind SMTP 5.0
MIME-Version: 1.0
From: "West Wind Message Board" <support…(at)…west-wind.com>
To: "FoxInCloud Support - Thierry N." <thn…(at)…foxincloud.com>
Reply-To: noreply…(at)…west-wind.com
Date: 26 Aug 2021 13:13:28 -0700
Subject: re: Latin Characteres
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
X-GND-Status: PHISHING
Received-SPF: pass (spool1: domain of west-wind.com designates 198.61.254.27 as permitted sender) client-ip=198.61.254.27; envelope-from=bounce+22b225.da0bac-thn=foxincloud.com…(at)…west-wind.com; helo=so254-27.mailgun.net;
Authentication-Results: spool.mail.gandi.net;
	dkim=pass header.d=west-wind.com header.s=smtp header.b=wtXJ6FOk;
	spf=pass (spool.mail.gandi.net: domain of bounce…(at)…west-wind.com designates 198.61.254.27 as permitted sender) smtp.mailfrom=bounce…(at)…west-wind.com;
	dmarc=none

I should be able to write a rule to avoid that, thought you might want to know.

Gravatar is a globally recognized avatar based on your email address. re: Latin Characteres
  Rick Strahl
  FoxInCloud Support - Thierry N.
  Aug 28, 2021 @ 10:47am

That's your mail server (Ghandi?) adding that header, meaning it's flagging the messages based on some blacklists I guess. Nothing I can do about that...

FWIW, I get messages on three services (GMail, Outlook.com, and FastMail) and neither of those flag the messages.

+++ Rick ---

© 1996-2021