realbasic-nug
[Top] [All Lists]

Re: Japanese Text Encoding and nthField

To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: Japanese Text Encoding and nthField
From: Will Leshner <leshner at ljug dot com>
Date: Wed, 29 Sep 2004 21:56:17 -0700
Delivered-to: realbasic-nug at lists dot realsoftware dot com
References: <p06110400bd812aeb99ba at [10 dot 0 dot 1 dot 5]>

On Sep 29, 2004, at 8:23 PM, Joe Huber wrote:

Here's a version of your code that works OK for me on 10.3.5 with RB 5.5.3



Of course, that works because the string ends up as UTF8, not Shift-JIS. Try this:


  dim s0, s1, s2, tab as string
  tab = chr(9)
  s0 = Encodings.ShiftJIS.chr(&h8AE7) + tab + "AB"
  s0 = ConvertEncoding(s0, Encodings.ShiftJIS)
  s1 = nthField(s0,tab,1)
  s2 = nthField(s0,tab,2)
  EditField1.text = s1 + "," + s2
  msgBox str(lenB(s1)) + " and " + str(lenB(s2))


That should work, assuming NthField works with Shift-JIS. But, alas, it doesn't work.

--
REALbasic database options: http://sqlabs.net
REALbasic news and tips: http://rbgazette.com
KidzMail & KidzLog: http://haranbanjo.com

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://www.realsoftware.com/listarchives/lists.html>

<Prev in Thread] Current Thread [Next in Thread>