Re: Failed to archive JPEG (ArchiveMember): Invalid UTF-8 sequence (at index 1)

2023-01-13 Thread Ki Rill via Digitalmars-d-learn
On Saturday, 14 January 2023 at 01:13:33 UTC, Adam D Ruppe wrote: On Saturday, 14 January 2023 at 01:08:25 UTC, Ki Rill wrote: a JPEG image. member.expandedData(file.readText().dup().representation()); A jpeg image is not a text file. Read it with `std.file.read()` instead of `readText`

Re: Failed to archive JPEG (ArchiveMember): Invalid UTF-8 sequence (at index 1)

2023-01-13 Thread Adam D Ruppe via Digitalmars-d-learn
On Saturday, 14 January 2023 at 01:08:25 UTC, Ki Rill wrote: a JPEG image. member.expandedData(file.readText().dup().representation()); A jpeg image is not a text file. Read it with `std.file.read()` instead of `readText`. Then you can get rid of those useless dup.representation calls to

Failed to archive JPEG (ArchiveMember): Invalid UTF-8 sequence (at index 1)

2023-01-13 Thread Ki Rill via Digitalmars-d-learn
Please, help me solve the annoying error above. I've been refactoring and rewriting code for my archive utility called [zippo](https://github.com/rillki/zippo) and I face this error when it tries to archive a JPEG image. I tracked it down to the following function that helps me add a new memb

Re: Proper way to fix core.exception.UnicodeException@src\rt\util\utf.d(292): invalid UTF-8 sequence by File.readln()

2018-04-06 Thread Jonathan M Davis via Digitalmars-d-learn
deException@src\rt\util\utf.d(292): invalid > >UTF-8 sequence > > (it happend when the user took the originally UTF8 encoded file > generated by another application, made some edit using an editor > (which I don't know the name) then saved not aware it was > changing the encodi

Proper way to fix core.exception.UnicodeException@src\rt\util\utf.d(292): invalid UTF-8 sequence by File.readln()

2018-04-06 Thread Dr.No via Digitalmars-d-learn
I'm reading line by line the lines from a CSV file provided by the user which is assumed to be UTF8. But an user has provided an ANSI file which resulted in the error: core.exception.UnicodeException@src\rt\util\utf.d(292): invalid UTF-8 sequence (it happend when the user too

Re: invalid utf-8 sequence

2009-01-07 Thread Stewart Gordon
james wrote: Jarrett Billingsley Wrote: On Tue, Jan 6, 2009 at 8:04 PM, james wrote: im writing an indexer, but im having a problem because on some file, when i read gives this error Error 4: invalid UTF-8 sequence is there a way to fix it. You're probably reading a file that'

Re: invalid utf-8 sequence

2009-01-06 Thread Jarrett Billingsley
On Tue, Jan 6, 2009 at 10:34 PM, james wrote: >> Not that I know of, for D anyway. > > i just found out about a function 'UnicodeFile' in tango, but im using D1.0 > and phobos, maybe i should write one of my own. > It wouldn't help you anyway. UnicodeFile reads.. uh, Unicode files. Your file is

Re: invalid utf-8 sequence

2009-01-06 Thread james
en i read gives this error > >> > > >> > Error 4: invalid UTF-8 sequence > >> > > >> > is there a way to fix it. > >> > > >> > >> You're probably reading a file that's encoded in some non-Unicode > >> enc

Re: invalid utf-8 sequence

2009-01-06 Thread Jarrett Billingsley
On Tue, Jan 6, 2009 at 9:20 PM, james wrote: > Jarrett Billingsley Wrote: > >> On Tue, Jan 6, 2009 at 8:04 PM, james wrote: >> > im writing an indexer, but im having a problem because on some file, when >> > i read gives this error >> > >> > Erro

Re: invalid utf-8 sequence

2009-01-06 Thread james
Jarrett Billingsley Wrote: > On Tue, Jan 6, 2009 at 8:04 PM, james wrote: > > im writing an indexer, but im having a problem because on some file, when i > > read gives this error > > > > Error 4: invalid UTF-8 sequence > > > > is there a way to fix it.

Re: invalid utf-8 sequence

2009-01-06 Thread Stewart Gordon
james wrote: im writing an indexer, but im having a problem because on some file, when i read gives this error Error 4: invalid UTF-8 sequence is there a way to fix it. Probably, but since you've decided not to post your code, nobody can tell you for sure what that way is. Mor

Re: invalid utf-8 sequence

2009-01-06 Thread Jarrett Billingsley
On Tue, Jan 6, 2009 at 8:04 PM, james wrote: > im writing an indexer, but im having a problem because on some file, when i > read gives this error > > Error 4: invalid UTF-8 sequence > > is there a way to fix it. > You're probably reading a file that's encoded in

invalid utf-8 sequence

2009-01-06 Thread james
im writing an indexer, but im having a problem because on some file, when i read gives this error Error 4: invalid UTF-8 sequence is there a way to fix it.