Loading ...
Sorry, an error occurred while loading the content.

997Re: UTF8 issue

Expand Messages
  • Philip Mak
    Jan 29, 2003
    • 0 Attachment
      On Wed, Jan 29, 2003 at 10:57:12AM -0800, Fernando Munoz wrote:
      > Thanks Phillip, that solves the problem. I managed myself to find a less
      > elegant but, equally effective, solution. I operates over the string passing
      > the result to a second scalar that gets encoded as a string of bytes:
      >
      > my $lstring = length($description);
      > my $newdesc = substr($description,0,$lstring); <- Here $newdesc has $description as a string of bytes
      >
      > After this the digests are all different and correct. It is not
      > elegant but works.

      Using substr() to unset the string's UTF8 flag seems to be a dangerous
      thing to do; it may work now, but if a future version of Perl changes
      substr() to understand characters instead of bytes, then your above
      code would end up having no effect.

      ---------------------------------------------------------------------
      To unsubscribe, e-mail: asp-unsubscribe@...
      For additional commands, e-mail: asp-help@...
    • Show all 8 messages in this topic