tag:blogger.com,1999:blog-34020393.post116086859362528472..comments2024-03-27T10:59:38.307-07:00Comments on Jim's PeopleSoft Journal: Hex Encoding CharactersJim Marionhttp://www.blogger.com/profile/12995110203807924786noreply@blogger.comBlogger8125tag:blogger.com,1999:blog-34020393.post-80541474171269923392010-04-21T13:15:11.315-07:002010-04-21T13:15:11.315-07:00@jarodmerle, :)@jarodmerle, :)Jim Marionhttps://www.blogger.com/profile/12995110203807924786noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-53168233963586435672010-04-21T13:04:07.697-07:002010-04-21T13:04:07.697-07:00You bet, your blog is great, so I figured it was a...You bet, your blog is great, so I figured it was about time I contribute even something of minimal value rather than being a total freeloader :). I have to respect fellow JJM's after all.Jarod Merlehttps://www.blogger.com/profile/06363331883108943615noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-64313802954047698782010-04-21T13:00:03.999-07:002010-04-21T13:00:03.999-07:00@jarodmerle, Well done. Thank you.@jarodmerle, Well done. Thank you.Jim Marionhttps://www.blogger.com/profile/12995110203807924786noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-11587024195569197442010-04-21T12:56:25.319-07:002010-04-21T12:56:25.319-07:00It's probably more work than what you did, but...It's probably more work than what you did, but you could do something like this natively in PeopleCode without using a Java Object:<br /><br /><i>Function hexVal(&iH As integer) Returns string<br /> If &iH <= 9 Then<br /> Return String(&iH);<br /> Else<br /> Return String(Char(Mod(&iH, 9) + 64));<br /> End-If;<br />End-Function;<br /><br />Function toHex(&iV As integer) Returns string<br /> Local integer &iH = Mod(&iV, 16);<br /> Local string &sResult = "";<br /> <br /> If &iV - &iH = 0 Then<br /> &sResult = hexVal(&iH);<br /> Else<br /> &sResult = toHex(Int((&iV - &iH) / 16)) | hexVal(&iH);<br /> End-If;<br /> <br /> Return &sResult;<br />End-Function;<br /><br />&sHexValue = hexVal(Code("A"));</i><br /><br />Not super fancy, but it works. I snagged the algorithm from <a href="http://en.wikipedia.org/wiki/Hexadecimal" rel="nofollow">Wikipedia</a> and converted it to PeopleCode.Jarod Merlehttps://www.blogger.com/profile/06363331883108943615noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-72216993002562799652010-04-14T15:47:08.017-07:002010-04-14T15:47:08.017-07:00Yes, actually, I am familiar with PET. I use it He...Yes, actually, I am familiar with PET. I use it <a href="http://jjmpsj.blogspot.com/2009/05/base64-encoding-with-pluggable.html" rel="nofollow">Here</a>. I'll have to look into that for this case.Jim Marionhttps://www.blogger.com/profile/12995110203807924786noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-49758810426249215892010-04-14T15:08:04.926-07:002010-04-14T15:08:04.926-07:00have you ever considered PeopleSoft PET ?
there ar...have you ever considered PeopleSoft PET ?<br />there are several algorithm like PSHexEncode and PSHexDecode ...Stéphane Lapierrehttps://www.blogger.com/profile/09041972817954751780noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-16695614002731442302010-04-14T08:13:04.343-07:002010-04-14T08:13:04.343-07:00@Bauke, JSON.simple is my favorite JSON library. Y...@Bauke, JSON.simple is my favorite JSON library. Yes, I have considered, and do use it. I have another blog post in the works about that. I wanted to post it last night, but didn't quite get it finished.Jim Marionhttps://www.blogger.com/profile/12995110203807924786noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-11849483078000497202010-04-14T01:55:08.019-07:002010-04-14T01:55:08.019-07:00Have you considered using JSON.simple?
http://cod...Have you considered using JSON.simple?<br /><br />http://code.google.com/p/json-simple/Bauke Gehemhttps://www.blogger.com/profile/09761227759156233502noreply@blogger.com