htTIP : encode ISO-8859-x / WINDOWS-x

Discuss anything else that does not suite other forums.

Moderator: Rathinagiri

Post Reply
User avatar
AUGE_OHR
Posts: 319
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany
Has thanked: 34 times
Been thanked: 41 times

htTIP : encode ISO-8859-x / WINDOWS-x

Post by AUGE_OHR » Sat Nov 30, 2019 8:04 am

hi,

i wonder why i get no German "Umlaute" and found out that "StrDekMIME" use

Code: Select all

   DO CASE
      CASE kodowanie='UTF-8' .OR. kodowanie='UTF8'
         lkod:=.T.
         NewString:=NewString+hb_Utf8ToStr(TString)
      CASE kodowanie='ISO-8859-2'
         lkod:=.T.
         NewString:=NewString+hb_Translate(TString,'PLISO')
      CASE kodowanie='WINDOWS-1250' .OR. kodowanie='WINDOWS1250' .OR. kodowanie='1250'
         lkod:=.T.
         NewString:=NewString+hb_Translate(TString,'PLWIN')
      OTHER
         NewString:=NewString+TString
   ENDCASE
i got email with
Thunderbird/68.2.2
MIME-Version: 1.0
"charset=windows-1252"
Content-Language: en-US
or
Content-Type: text/plain;
'charset="iso-8859-1"'
Content-Transfer-Encoding: 7bit
so i try to change Lines to these Type

Code: Select all

      CASE kodowanie='ISO-8859-1' // <- 1
         lkod:=.T.
         NewString:=NewString+hb_Translate(TString,'PLISO')
      CASE kodowanie='WINDOWS-1252' .OR. kodowanie='WINDOWS1252' .OR. kodowanie='1252'
         lkod:=.T.
         NewString:=NewString+hb_Translate(TString,'PLWIN')
but it crash at hb_Translate()
Error BASE/1302 Argument error: HB_TRANSLATE
Called from HB_TRANSLATE(0)
Called from STRDEKMIME(674)
Called from DEKODUJMIME(612)
Called from GETEMAIL(383)
Called from (b)MAIN(83)
Called from _PROCESSINITPROCEDURE(5876)
Called from _ACTIVATEWINDOW(5627)
Called from MAIN(174)
so how to implement 'ISO-8859-1' and 'WINDOWS-1252' :idea:

please help, thx

Post Reply