|
On Fri, 03 Nov 2006 12:54:41 -0500 Barbara Morris <bmorris@xxxxxxxxxx> wrote:
Brad Stone wrote:On Thu, 02 Nov 2006 23:46:30 -0500 "Brad Stone" <brad@xxxxxxxxxxxx> wrote: I think I just answered my own question. It appears in mixed strings of SBCS and DBCS the shift in and outDBCSdelimiters X'0E' and X'0F' Not sure why I didn't see them before. Well, that makes my replace procedure much more fun.:) Iassume I just have to first find these two delimiters anywhere in the string, and when scanning forreplacementcharacters ignore anything in between these two values anywhere in the string...A fairly easy way to handle this is to do the processing in ucs2. (At least, it's easy, if your string doesn't have more than 16383 total characters, since that's the maximum number of UCS2 characters that RPG supports.) D lparen c %ucs2('(') D rparen c %ucs2(')') D apos c %ucs2('''') D string s 16383c varying string = %ucs2(charstring); --- use all the same code as you had before --- p = %scan(lparen : string); etc charstring = %char(string); -- This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/rpg400-l or email: RPG400-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/rpg400-l.
Barbara, Could you explain what this does a little further? I found this on Wikipedia: http://en.wikipedia.org/wiki/UTF-16 But, of course, it's a bit confusing. In a nutshell, it sounds like this may convert all characters, either SCBS or DBCS to unique values so that there is no way a DBCS value can contain a byte that is equal to a SBCS value and this problem would be eliminated? Thanks! I appreciate this type of input.. could make my string searching/replacing a lot easier than finding the Si an So bytes and making sure replacement caracters are not between these. Bradley V. Stone BVS.Tools www.bvstools.com
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.