Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LTA error message when reading something in UTF-8 mode that isn't UTF-8 #2587

Closed
p6rt opened this issue Dec 28, 2011 · 5 comments
Closed

LTA error message when reading something in UTF-8 mode that isn't UTF-8 #2587

p6rt opened this issue Dec 28, 2011 · 5 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Dec 28, 2011

Migrated from rt.perl.org#107204 (status was 'resolved')

Searchable as RT107204$

@p6rt
Copy link
Author

p6rt commented Dec 28, 2011

From @masak

<fsergot> what to do if slurp gives "malformed utf8 string"? :)
<tadzik> look twice at your file :)
<huf> iconv and check where it breaks;)
<fsergot> great! thanks :)
<fsergot> huf++
<fsergot> tadzik++
<fsergot> it works! :)
<masak> maybe we should give a more informative error message when
file input chokes on some non-UTF-8.
<fsergot> would be great :)
<fsergot> maybe line number? :)
<masak> the only reason there isn't already a line number is that it's
an error emitted by Parrot.
<masak> we should catch it and re-package it.
* masak submits rakudobug

@p6rt
Copy link
Author

p6rt commented Aug 7, 2015

From @ShimmerFairy

Error messages seem to be sufficiently awesome now​:

  $ perl6 -e 'say "aouÄÖÜ".encode("latin1").decode("utf8")'
  Malformed UTF-8 at line 1 col 4
  in block <unit> at -e​:1

  $ perl6 -e 'say "ssß".encode("latin1").decode("utf8")'
  Malformed termination of UTF-8 string
  in block <unit> at -e​:1

Unless there are tests that could be written for this (or they already exist), I say this bug can be closed.

@p6rt
Copy link
Author

p6rt commented Aug 7, 2015

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Aug 9, 2015

From @skids

I added tests for this in S32-str/encode.t.

However, I also added fudged tests because UTF-16 is not similarly
awesomized to display line and column or terminator text.

@p6rt p6rt closed this as completed Apr 7, 2016
@p6rt
Copy link
Author

p6rt commented Apr 7, 2016

@diakopter - Status changed from 'open' to 'resolved'

@p6rt p6rt added the Bug label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant