Skip to content

Use stream position instead of counting read bytes.#199

Merged
tonyroberts merged 1 commit into
pythonnet:developfrom
tonyroberts:develop
Apr 4, 2016
Merged

Use stream position instead of counting read bytes.#199
tonyroberts merged 1 commit into
pythonnet:developfrom
tonyroberts:develop

Conversation

@tonyroberts

Copy link
Copy Markdown
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

stonebig commented Apr 4, 2016

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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

stonebig commented Apr 4, 2016

Copy link
Copy Markdown
Contributor

no problem, thanks!

@den-run-ai

Copy link
Copy Markdown
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

stonebig commented Apr 4, 2016

Copy link
Copy Markdown
Contributor

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