Skip to content

Use stream position instead of counting read bytes. #199

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

Merged
merged 1 commit into from
Apr 4, 2016

Conversation

tonyroberts
Copy link
Contributor

FileStream.Read returns (bytes read, buffer), not just bytes read as the
buffer is passed by reference. This is a bit unintuative, but checking the
position is clear and less error prone.

FileStream.Read returns (bytes read, buffer), not just bytes read as the
buffer is passed by reference. This is a bit unintuative, but checking the
position is clear and less error prone.
@tonyroberts tonyroberts merged commit bc414e1 into pythonnet:develop Apr 4, 2016
@stonebig
Copy link
Contributor

stonebig commented Apr 4, 2016

so now:

  • I can open, modify, save,
  • all is apparently ok if I stay in ascii letter,
  • if I type this:
the Euro Symbol is "€"
c'est la fête à Paris !
  • I save, and when I reload (or look via notepad++):
the Euro Symbol is "?"
c'est la f?te ? Paris !

.... you may have not saved as utf-8 ? (with a BOM or not, I don't think it changes the loss of the "€")

Still, Awesome progress (I don't know if the last issue is Pythonnet related or an example that gets too complicated, if it's just an example issue, I'm dying to get that dev2)

@tonyroberts
Copy link
Contributor Author

Right, well I think as a demo it's now adequately showing how Python and c#
can interact. I don't think it warrants much more time spent on it, but I
don't mind reviewing pull requests if you want to fix it up some more.
On Mon, Apr 4, 2016 at 7:14 PM stonebig notifications@github.com wrote:

so now:

  • I can open, modify, save,
  • all is apparently ok if I stay in ascii letter,
  • if I type this:

the Euro Symbol is "€"
c'est la fête à Paris !

  • I save, and when I reload (or look via notepad++:

the Euro Symbol is "?"
c'est la f?te ? Paris !


You are receiving this because you modified the open/close state.
Reply to this email directly or view it on GitHub
#199 (comment)

@stonebig
Copy link
Contributor

stonebig commented Apr 4, 2016

no problem, thanks!

@den-run-ai
Copy link
Contributor

@stonebig @tonyroberts - this demo also has to be adapted to python 3 for
managing str/byte/unicode conversion properly using six module.

On Mon, Apr 4, 2016 at 1:22 PM, stonebig notifications@github.com wrote:

no problem, thanks!


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
#199 (comment)

@stonebig
Copy link
Contributor

stonebig commented Apr 4, 2016

trying to get this example working in all current combinations could drown the project resources.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants