• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Truncating UTF-8 Strings
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Truncating UTF-8 Strings


  • Subject: Re: Truncating UTF-8 Strings
  • From: Andrew Lindesay <email@hidden>
  • Date: Tue, 9 Jun 2009 09:40:37 +1200


Hello Klaus;

If you render the original string, I presume that it does not contain the corrupted UTF-8 sequence and renders the glyphs correctly?

returnValue = new String(textBlock.toString().getBytes("UTF-8"), 0, lengthTruncated, "UTF-8");

^^^ I know you tried it using sub-strings, but this above would definitely cause trouble as it could break inside multi-byte sequences.


cheers.

___
Andrew Lindesay
www.lindesay.co.nz

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Truncating UTF-8 Strings
      • From: Klaus Berkling <email@hidden>
References: 
 >Truncating UTF-8 Strings (From: Klaus Berkling <email@hidden>)

  • Prev by Date: Truncating UTF-8 Strings
  • Next by Date: [WWDC] Any supper plans for Monday?
  • Previous by thread: Truncating UTF-8 Strings
  • Next by thread: Re: Truncating UTF-8 Strings
  • Index(es):
    • Date
    • Thread