Page 4 of 4 FirstFirst ... 2 3 4
Results 31 to 32 of 32

Thread: Data Encryption Business Function

  1. #31
    Senior Member
    Join Date
    Mar 2004
    Location
    Fort Worth, Texas
    Posts
    1,579
    There may be a workaround to still do it in JDE but I would have to think about it. Not sure if you could simply transcode (convert) the b64 encoded string from UTF8 to ISO-8859-1 before passing to decodeB64 or not. The BSFN that I posted also wants ISO-8859-1 as well. Guess I should have made my BSFN like the link I posted and allow user to determine the character set.
    Brian Oster
    Application Development Manager
    E1: 9.0 (TR9.1.5.1) / 9.2 (TR9.2.2.2)
    JAS/BSSV: Weblogic 12.1.2 / Weblogic 12.2
    ES: Win2008 / Win2016
    DB: MSSQL 2014 / 2016
    WebDev Client: Win7Pro / Win10Pro

  2. #32
    Senior Member
    Join Date
    Mar 2004
    Location
    Fort Worth, Texas
    Posts
    1,579
    So I did get to thinking about it and my apologies ashwin E1. I think you were right. You do need to transcode the output. Base64 doesn't care about the input character set because it only uses the first 0-127 characters which, regardless of the charset, are all coded the same (ASCII). In the case of a string output like what you are doing you do need to the know the character set of the original source and transcode it. The following code should work for you. Notice the API call to jdeToUnicode, that is all that really changed.

    Code:
    	ZCHAR		*pszBuf = (ZCHAR *)NULL;
    	JCHAR		*pszEncodedB64 = _J("QkhLTCBDb21taXNzaW9ucyAzw6htZSBUciAyMDE5LnBkZg==?="),
    				szStringOut[501] = {0};
    	int		nEncodedSize = 0,
    				nBufSize = 0;
    
    
    	/*****  Decode *****/
    	nEncodedSize = jdeStrlen(pszEncodedB64);
    	nBufSize = ((((nEncodedSize) / 4) + ((nEncodedSize) % 4 != 0 ? 1:0)) * 3) + sizeof(ZCHAR);
    	pszBuf = jdeAlloc(COMMON_POOL, nBufSize, MEM_ZEROINIT);
    	decodeB64((BYTE *)pszBuf, &nBufSize, pszEncodedB64);
    	jdeToUnicode(szStringOut, pszBuf, DIM(szStringOut), _J("UTF8"));
    
    	/* free resources */
    	jdeFree(pszBuf);
    Brian Oster
    Application Development Manager
    E1: 9.0 (TR9.1.5.1) / 9.2 (TR9.2.2.2)
    JAS/BSSV: Weblogic 12.1.2 / Weblogic 12.2
    ES: Win2008 / Win2016
    DB: MSSQL 2014 / 2016
    WebDev Client: Win7Pro / Win10Pro

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
The legal restrictions and terms of use applicable to this site are available here.
Use of this site signifies your agreement to the terms of use.
JDELIST is NOT affiliated with JD Edwards® & Company, Oracle or Peoplesoft. Contents of this site are neither endorsed nor approved by JD Edwards® & Company and, or Oracle.