Separate issue caused by encoding?

Hi,

I have an issue with what maybe an encoding problem with a text file.

The file is a .ply file from blender.

I am trying to use reader and some regexs to strip out the vertices, normals and indices.

P
My aim being some slightly less tedious importing of meshes as polys for DX9/DX11

Issue…

I have discovered by looking at the file in notepad++ the file is ansi encoded.
If I look at it notepad++ all looks good. Apart from Unix line feeds

However in my patch some of the data is getting truncated by separate (string) to the wrong values this seems to be where
some of the lf’s are (linefeeds) because of the Unix line feeds.

Any hints on how to deal with this in vvvv? separate help node gives a hint, but no use case.

I have tried various encoding settings the pin on the reader node too…but no luck.

Thanks in advance.

can include a patch and the .ply file if needed.

needed

Files …

----------separate.7z (8.2 KB)

here we go…

PS… the Forum is terrible on a mobile!

I think ive got it.!!

I needed a regex that swapped the LF for a space first.

or simply use two Separate (String) nodes:

  • first one with Interspace set to “NewLineAutoDetection” which understands all lineendings and returns a spread of lines
  • second one with Interspace set to “Space”

see?

1 Like

Yes I do. Thanks Joreg.

My aim today was to learnt some regex…

This took me down a fascinating path into encodings and their differences…ascii…ansi …utf etc…win/linux differences…quite a subject.

quite a subject indeed, but luckily in vvvv you hardly every have to deal with it. strings in vvvv are always (always!) unicode and with any string nodes you don’t have to think about encodings at all.

only when reading/writing to/from a file or the network you have to deal with encodings but really nowadays luckily mostly all is utf8 for those cases. so yes it was a big issue a few years ago but now it you shouldn’t need to deal with it much.

different line-endings still exist but are easily converted, so also no big deal.

hah, just stumbled upon this little “character encoding primer” i wrote a while back that could be an interesting read on the topic. https://vvvv.org/documentation/character-encoding

This is the one I found.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.