What happened to my language?

Rick Zoerner wrote:

Hi all,

I save a file from a wxTextCtrl using the SaveFile method. Then I close the
program.
I can view that file in Notepad and it is exactly what I typed in the
wxTextCtrl. Perfect.
Then I re-open the program and load in the file to the wxTextCtrl using the
LoadFile method.

Chinese.

Why? And... how do I stop that?

This is probalbly not real Chinese, but an end of line (eol) issue.
In Python, the 'official' eol is '\n'. On win platform, the eol
is '\r\n'.
The wxTextCtrl does not recognize '\r\n', so when you save you
text, the text will be saved with '\n' instead of '\r\n' eol marks.

Beside this, I should say, that NotePad is still one of the most
strupid editor around. It can not change the '\n' on the fly.

How to work around
- replace in the text all '\n' by '\r\n' before you save it
- make some more tests with Word, OOo, SciTe, ...
- replace the NotePad application by one another small
text editor. The web is full of them.

Jean-Michel Fauth, Switzerland

Jean-Michel Fauth wrote:

This is probably not real Chinese, but an end of line (eol) issue.
In Python, the 'official' eol is '\n'. On win platform, the eol
is '\r\n'.
The wxTextCtrl does not recognize '\r\n', so when you save you
text, the text will be saved with '\n' instead of '\r\n' eol marks.

Beside this, I should say, that NotePad is still one of the most
stupid editor around. It can not change the '\n' on the fly.

How to work around
- replace in the text all '\n' by '\r\n' before you save it
- make some more tests with Word, OOo, SciTe, ...
- replace the NotePad application by one another small
text editor. The web is full of them.

Jean-Michel Fauth, Switzerland

So, what you're saying is that NotePad is bad because it can't use both the
'\n' and '\r\n' - and wxTextCtrl is O.K. because IT can't use both the '\n'
and '\r\n'? Interesting logic.

Aside from being picky about the above, I really do appreciate the response,
the lead and the suggestions. Thank you for those.

I'm not sure how to change the EOL character, though, since I'm using
nothing but wxPython native controls (wxTextCtrl.SaveFile-->out and
wxTextCtrl.LoadFile-->in) so I don't understand either why I should have to
interact with the bytestream in-between, or even how I can.

What language is 'my' language?
What OS are you using; are you using a wxPython version that
supports unicode?

Chinese characters also may be displayed when a high-ascii
character--such as letters with diacritics in French or Swedish,
for example--are used, and the wrong locale/character set is
assumed.

John

···

-----Original Message-----
From: Jean-Michel Fauth [mailto:jmfauth@bluewin.ch]
Sent: 2004 01 18 10:24
To: wxPython-users@lists.wxwindows.org
Subject: [wxPython-users] What happened to my language?

Rick Zoerner wrote:

> Hi all,

> I save a file from a wxTextCtrl using the SaveFile method.
Then I close the
> program.
> I can view that file in Notepad and it is exactly what I
typed in the
> wxTextCtrl. Perfect.
> Then I re-open the program and load in the file to the
wxTextCtrl using the
> LoadFile method.

> Chinese.

> Why? And... how do I stop that?

This is probalbly not real Chinese, but an end of line (eol) issue.
In Python, the 'official' eol is '\n'. On win platform, the eol
is '\r\n'.
The wxTextCtrl does not recognize '\r\n', so when you save you
text, the text will be saved with '\n' instead of '\r\n' eol marks.

Beside this, I should say, that NotePad is still one of the most
strupid editor around. It can not change the '\n' on the fly.

How to work around
- replace in the text all '\n' by '\r\n' before you save it
- make some more tests with Word, OOo, SciTe, ...
- replace the NotePad application by one another small
text editor. The web is full of them.

John Li wrote:

What language is 'my' language?
What OS are you using; are you using a wxPython version that
supports unicode?

Chinese characters also may be displayed when a high-ascii
character--such as letters with diacritics in French or Swedish,
for example--are used, and the wrong locale/character set is
assumed.

John

I'm sorry, I should have thought of that. I'm running Python 2.3/wxPython
2.4.2.4u on WinXP in English. Yes, I believe I installed w/unicode support.

I should probably also not that so far my testing has been limited to
documents of only 1-4 lines in length (just to see if I really could save
and retrieve) and either no or one carriage-return. I have not even begun to
play with setting font or anything else so all wxTextCtrl and wxFont
attributes are whatever happens when you initialize the control.

Also, I think Jean-Michel was on to something because I have noticed (and it
is consistent) that after I "read in" my saved file, if I try to highlight
or select the text - it all just disappears to an empty control. So it
appears there's nothing tangible actually being brought in.

I know after I save a newly written file to disk I can check it by opening
it with any other word-processor in text/ascii mode and it reads in just
fine. So the wxTextCtrl.SaveFile method seems to be working perfectly fine.
It's just that the wxTextCtrl.LoadFile method doesn't seem able to
(correctly) load back in its own file.

I can't help but feel like I'm missing something real basic because this
seems like it should be such a no-brainer. I'm using two methods from the
same control with no further embellishment on my part. The actual text is
seldom more than just the word "test" or maybe one short sentence.

All suggestions gratefully accepted - this has become something of a
show-stopper for me.

File definitions for "New", "Open", "Close", "Save", "Save As" :

    def OnFileNew(self, event):
        """File > New"""
        try:
            self.pages = self.pages + 1
        except:
            self.pages = 2 #the calling class creates the notebook with 1
page
           #named "new (1)" upon initialization - it can't start
           #blank and call "New" due to sequence-of-operation problems.
        self.notebook_1_pane_1 = wxPanel(self.pane.notebook_1, -1)
        self.text_ctrl = wxTextCtrl(self.notebook_1_pane_1, -1, "",
         style=wxTE_MULTILINE|wxTE_RICH)
        sizer_2 = wxBoxSizer(wxHORIZONTAL)
        sizer_2.Add(self.text_ctrl, 1, wxEXPAND, 0)
        self.notebook_1_pane_1.SetAutoLayout(1)
        self.notebook_1_pane_1.SetSizer(sizer_2)
        sizer_2.Fit(self.notebook_1_pane_1)
        sizer_2.SetSizeHints(self.notebook_1_pane_1)
        self.title = "new (" + repr(self.pages) + ")"
        self.pane.notebook_1.AddPage(self.notebook_1_pane_1, self.title)
        CTRL[self.title] = self.text_ctrl
        DIR[self.title] = "none"
        FILE[self.title] = "none"

    def OnFileOpen(self, event):
        """File > Open file(s)"""
        defaultDir=os.path.join(PROG['root'],"data")
        dlg = wxFileDialog(self.frame, "Choose a file",
            defaultDir=defaultDir, defaultFile="",
            wildcard="Writer Files(*.wtr)|*.wtr|Text
Files(*.txt;*.asc)|*.txt;*.asc|All files (*.*)|*.*",
            style=wxOPEN|wxMULTIPLE)
        if dlg.ShowModal() == wxID_OK:
            self.page = self.pane.notebook_1.GetSelection()
            self.tab = self.pane.notebook_1.GetPageText(self.page)
            self.ctrl = CTRL[self.tab]
            if self.ctrl.GetLastPosition() == 0:
                self.pane.notebook_1.RemovePage(self.page)
            fileList = dlg.GetPaths()
            for f in fileList:
                self.notebook_1_pane_1 = wxPanel(self.pane.notebook_1, -1)
                self.text_ctrl = wxTextCtrl(self.notebook_1_pane_1, -1, "",
             style=wxTE_MULTILINE|wxTE_RICH)
                sizer_2 = wxBoxSizer(wxHORIZONTAL)
                sizer_2.Add(self.text_ctrl, 1, wxEXPAND, 0)
                self.notebook_1_pane_1.SetAutoLayout(1)
                self.notebook_1_pane_1.SetSizer(sizer_2)
                sizer_2.Fit(self.notebook_1_pane_1)
                sizer_2.SetSizeHints(self.notebook_1_pane_1)
                self.name, self.ext = os.path.splitext(FILE[self.tab])
                self.pane.notebook_1.AddPage(self.notebook_1_pane_1,
self.name)
                CTRL[self.name] = self.text_ctrl
                DIR[self.name] = dlg.GetDirectory()
                FILE[self.name] = dlg.GetFilename()
                self.text_ctrl.LoadFile(f)
        dlg.Destroy()
        self.pane.notebook_1.Refresh()

    def OnFileClose(self,event):
        """File > Close file"""
        self.page = self.pane.notebook_1.GetSelection()
        self.pane.notebook_1.RemovePage(self.page)

    def OnFileSave(self, event):
        """File > Save file"""
        self.page = self.pane.notebook_1.GetSelection()
        self.tab = self.pane.notebook_1.GetPageText(self.page)
        if FILE[self.tab]=="none":
            self.OnFileSaveAs(event)
        else:
            path = os.path.join(DIR[self.tab], FILE[self.tab])
            self.ctrl = CTRL[self.tab]
            self.ctrl.SaveFile(path)

    def OnFileSaveAs(self, event):
        """File > Save file as"""
        self.page = self.pane.notebook_1.GetSelection()
        self.tab = self.pane.notebook_1.GetPageText(self.page)
        self.ctrl = CTRL[self.tab]
        defaultDir=os.path.join(PROG['root'],"data")
        defaultFile=""
        dlg = wxFileDialog(self.frame, "Save As",
    defaultDir=defaultDir,defaultFile=defaultFile,
            wildcard="Writer Files(*.wtr)|*.wtr|Text Files(*.txt)|*.txt|All
files (*.*)|*.*",
            style=wxSAVE|wxOVERWRITE_PROMPT|wxCHANGE_DIR)
        if dlg.ShowModal() == wxID_OK:
            path = dlg.GetPath()
            DIR[self.tab] = dlg.GetDirectory()
            FILE[self.tab] = dlg.GetFilename()
            self.name, self.ext = os.path.splitext(FILE[self.tab])
            self.ctrl.SaveFile(path)
            self.pane.notebook_1.SetPageText(self.page, self.name)
        dlg.Destroy()
        self.pane.notebook_1.Refresh()

···

> -----Original Message-----
> From: Jean-Michel Fauth [mailto:jmfauth@bluewin.ch]
> Sent: 2004 01 18 10:24
> To: wxPython-users@lists.wxwindows.org
> Subject: [wxPython-users] What happened to my language?
>
>
> Rick Zoerner wrote:
>
> > Hi all,
>
> > I save a file from a wxTextCtrl using the SaveFile method.
> Then I close the
> > program.
> > I can view that file in Notepad and it is exactly what I
> typed in the
> > wxTextCtrl. Perfect.
> > Then I re-open the program and load in the file to the
> wxTextCtrl using the
> > LoadFile method.
>
> > Chinese.
>
> > Why? And... how do I stop that?
>
> This is probalbly not real Chinese, but an end of line (eol) issue.
> In Python, the 'official' eol is '\n'. On win platform, the eol
> is '\r\n'.
> The wxTextCtrl does not recognize '\r\n', so when you save you
> text, the text will be saved with '\n' instead of '\r\n' eol marks.
>
> Beside this, I should say, that NotePad is still one of the most
> strupid editor around. It can not change the '\n' on the fly.
>
> How to work around
> - replace in the text all '\n' by '\r\n' before you save it
> - make some more tests with Word, OOo, SciTe, ...
> - replace the NotePad application by one another small
> text editor. The web is full of them.

Rick Zoerner wrote:

John Li wrote:

What language is 'my' language?
What OS are you using; are you using a wxPython version that
supports unicode?

Chinese characters also may be displayed when a high-ascii
character--such as letters with diacritics in French or Swedish,
for example--are used, and the wrong locale/character set is
assumed.

John

I'm sorry, I should have thought of that. I'm running Python 2.3/wxPython
2.4.2.4u on WinXP in English. Yes, I believe I installed w/unicode support.

In that case then you are probably writing out unicode (ucs-16 ?) text to the file, but Notepad is expecting 8-bit ascii. If you want to save something else then use textCtrl.GetValue() and convert the unicode string to whatever you want and then write that to a file yourself.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

I don't think I am explaining myself well enough. I apologize for the
confusion this is causing. Notepad should not even be a part of the
equation. I only mentioned it at all to illustrate that the file being
written out *is* readable with any other text/ascii capable editor. That's
as far as the Notepad thing goes.

The problem is that I can save out a file (wxTextCtrl.SaveFile) - then,
close the app. Then, open the app. Then, load the exact same file using
wxTextCtrl.LoadFile... and get Chinese. No other interaction was done or
wanted. The wxTextCtrl.Loadfile method is not able to read and display the
exact file laid down by the wxTextCtrl.SaveFile method just a few seconds
earlier. AFTER it fails to load I can try to look at the file using NotePad
and see and load and work with it in Notepad just fine.

That's why I think I must be missing something simple and obvious - it
doesn't make sense to me why the file can't be read back in. I now have a
word processor that only works in one direction.

I also created a file in Notepad (a large part of the goal is to be able to
read in ANY text file) and saved it 4 times using each file-type option
available in Notepad (ANSI, Unicode, unicode big endian, UTF-8). I then
tried loading each of them, and none of them came in, either. The app
doesn't generate any error, but it just displays a blank page.

Is there something I'm missing about declaring a particular encoding or
something? I'm dead-in-the-water if I can't read the files back in.

Thanks, and I apologize if I'm being exceptionally dense here about
anything.
-Rick Zoerner

···

-----Original Message-----
From: Robin Dunn [mailto:robin@alldunn.com]
Sent: Monday, January 19, 2004 4:04 PM
To: wxPython-users@lists.wxwindows.org
Subject: Re: [wxPython-users] What happened to my language?

Rick Zoerner wrote:
> John Li wrote:
>
>
>>What language is 'my' language?
>>What OS are you using; are you using a wxPython version that
>>supports unicode?
>>
>>Chinese characters also may be displayed when a high-ascii
>>character--such as letters with diacritics in French or Swedish,
>>for example--are used, and the wrong locale/character set is
>>assumed.
>>
>>John
>
>
> I'm sorry, I should have thought of that. I'm running
Python 2.3/wxPython
> 2.4.2.4u on WinXP in English. Yes, I believe I installed
w/unicode support.

In that case then you are probably writing out unicode
(ucs-16 ?) text
to the file, but Notepad is expecting 8-bit ascii. If you
want to save
something else then use textCtrl.GetValue() and convert the unicode
string to whatever you want and then write that to a file yourself.

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
For additional commands, e-mail:
wxPython-users-help@lists.wxwindows.org

If you put your previous code in a small runnable app I'll take
a look at it--I'm no expert, but am looking at locale issues
right now.

John

···

-----Original Message-----
From: Rick Zoerner [mailto:rick@zoerner.com]
Sent: 2004 01 19 21:23
To: wxPython-users@lists.wxwindows.org
Subject: RE: [wxPython-users] What happened to my language?

I don't think I am explaining myself well enough. I apologize for the
confusion this is causing. Notepad should not even be a part of the
equation. I only mentioned it at all to illustrate that the file being
written out *is* readable with any other text/ascii capable
editor. That's
as far as the Notepad thing goes.

The problem is that I can save out a file
(wxTextCtrl.SaveFile) - then,
close the app. Then, open the app. Then, load the exact same
file using
wxTextCtrl.LoadFile... and get Chinese. No other interaction
was done or
wanted. The wxTextCtrl.Loadfile method is not able to read
and display the
exact file laid down by the wxTextCtrl.SaveFile method just a
few seconds
earlier. AFTER it fails to load I can try to look at the file
using NotePad
and see and load and work with it in Notepad just fine.

That's why I think I must be missing something simple and obvious - it
doesn't make sense to me why the file can't be read back in.
I now have a
word processor that only works in one direction.

I also created a file in Notepad (a large part of the goal is
to be able to
read in ANY text file) and saved it 4 times using each
file-type option
available in Notepad (ANSI, Unicode, unicode big endian,
UTF-8). I then
tried loading each of them, and none of them came in, either. The app
doesn't generate any error, but it just displays a blank page.

Is there something I'm missing about declaring a particular
encoding or
something? I'm dead-in-the-water if I can't read the files back in.

Thanks, and I apologize if I'm being exceptionally dense here about
anything.
-Rick Zoerner

> -----Original Message-----
> From: Robin Dunn [mailto:robin@alldunn.com]
> Sent: Monday, January 19, 2004 4:04 PM
> To: wxPython-users@lists.wxwindows.org
> Subject: Re: [wxPython-users] What happened to my language?
>
>
> Rick Zoerner wrote:
> > John Li wrote:
> >
> >
> >>What language is 'my' language?
> >>What OS are you using; are you using a wxPython version that
> >>supports unicode?
> >>
> >>Chinese characters also may be displayed when a high-ascii
> >>character--such as letters with diacritics in French or Swedish,
> >>for example--are used, and the wrong locale/character set is
> >>assumed.
> >>
> >>John
> >
> >
> > I'm sorry, I should have thought of that. I'm running
> Python 2.3/wxPython
> > 2.4.2.4u on WinXP in English. Yes, I believe I installed
> w/unicode support.
>
> In that case then you are probably writing out unicode
> (ucs-16 ?) text
> to the file, but Notepad is expecting 8-bit ascii. If you
> want to save
> something else then use textCtrl.GetValue() and convert the unicode
> string to whatever you want and then write that to a file yourself.
>
> --
> Robin Dunn
> Software Craftsman
> http://wxPython.org Java give you jitters? Relax with wxPython!
>
>
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
wxPython-users-unsubscribe@lists.wxwindows.org
> For additional commands, e-mail:
> wxPython-users-help@lists.wxwindows.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
For additional commands, e-mail:
wxPython-users-help@lists.wxwindows.org

From: John Li [mailto:johnli@ahlt.net]

If you put your previous code in a small runnable app I'll take
a look at it--I'm no expert, but am looking at locale issues
right now.

Thank you, John. I really appreciate you taking any time at all to try and
look at this for me. I've noticed this is like proof-reading your own
report - I see what I want to see more often than what is really there.

I'm sending this zip file with two things, actually. One is the small
(relatively), self-contained app that exhibits the problem. The rest is the
whole app as I have it so far. The code I ended up with trying to reduce it
was so ugly and twisted that while it does run, it may actually be easier to
trace relationships in the actual app.

The file unzips to a directory <RZA>. The reduced example is called
"textctrltest.py" in the parent directory. The file to run the whole app is
rza.py (or rzawin.pyw). Finally, the module from the app with the wxTextCtrl
code in it is <RZA\base\Writer.py>.

Thanks, again.
-Rick Zoerner

RZA.zip (230 KB)

···

-----Original Message-----

> -----Original Message-----
> From: Rick Zoerner [mailto:rick@zoerner.com]
> Sent: 2004 01 19 21:23
> To: wxPython-users@lists.wxwindows.org
> Subject: RE: [wxPython-users] What happened to my language?
>
>
> I don't think I am explaining myself well enough. I
apologize for the
> confusion this is causing. Notepad should not even be a part of the
> equation. I only mentioned it at all to illustrate that the
file being
> written out *is* readable with any other text/ascii capable
> editor. That's
> as far as the Notepad thing goes.
>
> The problem is that I can save out a file
> (wxTextCtrl.SaveFile) - then,
> close the app. Then, open the app. Then, load the exact same
> file using
> wxTextCtrl.LoadFile... and get Chinese. No other interaction
> was done or
> wanted. The wxTextCtrl.Loadfile method is not able to read
> and display the
> exact file laid down by the wxTextCtrl.SaveFile method just a
> few seconds
> earlier. AFTER it fails to load I can try to look at the file
> using NotePad
> and see and load and work with it in Notepad just fine.
>
> That's why I think I must be missing something simple and
obvious - it
> doesn't make sense to me why the file can't be read back in.
> I now have a
> word processor that only works in one direction.
>
> I also created a file in Notepad (a large part of the goal is
> to be able to
> read in ANY text file) and saved it 4 times using each
> file-type option
> available in Notepad (ANSI, Unicode, unicode big endian,
> UTF-8). I then
> tried loading each of them, and none of them came in,
either. The app
> doesn't generate any error, but it just displays a blank page.
>
> Is there something I'm missing about declaring a particular
> encoding or
> something? I'm dead-in-the-water if I can't read the files back in.
>
> Thanks, and I apologize if I'm being exceptionally dense here about
> anything.
> -Rick Zoerner
>
> > -----Original Message-----
> > From: Robin Dunn [mailto:robin@alldunn.com]
> > Sent: Monday, January 19, 2004 4:04 PM
> > To: wxPython-users@lists.wxwindows.org
> > Subject: Re: [wxPython-users] What happened to my language?
> >
> >
> > Rick Zoerner wrote:
> > > John Li wrote:
> > >
> > >
> > >>What language is 'my' language?
> > >>What OS are you using; are you using a wxPython version that
> > >>supports unicode?
> > >>
> > >>Chinese characters also may be displayed when a high-ascii
> > >>character--such as letters with diacritics in French or Swedish,
> > >>for example--are used, and the wrong locale/character set is
> > >>assumed.
> > >>
> > >>John
> > >
> > >
> > > I'm sorry, I should have thought of that. I'm running
> > Python 2.3/wxPython
> > > 2.4.2.4u on WinXP in English. Yes, I believe I installed
> > w/unicode support.
> >
> > In that case then you are probably writing out unicode
> > (ucs-16 ?) text
> > to the file, but Notepad is expecting 8-bit ascii. If you
> > want to save
> > something else then use textCtrl.GetValue() and convert
the unicode
> > string to whatever you want and then write that to a file
yourself.
> >
> > --
> > Robin Dunn
> > Software Craftsman
> > http://wxPython.org Java give you jitters? Relax with wxPython!

Rick Zoerner wrote:

I don't think I am explaining myself well enough. I apologize for the
confusion this is causing. Notepad should not even be a part of the
equation. I only mentioned it at all to illustrate that the file being
written out *is* readable with any other text/ascii capable editor. That's
as far as the Notepad thing goes.

The problem is that I can save out a file (wxTextCtrl.SaveFile) - then,
close the app. Then, open the app. Then, load the exact same file using
wxTextCtrl.LoadFile... and get Chinese. No other interaction was done or
wanted. The wxTextCtrl.Loadfile method is not able to read and display the
exact file laid down by the wxTextCtrl.SaveFile method just a few seconds
earlier. AFTER it fails to load I can try to look at the file using NotePad
and see and load and work with it in Notepad just fine.

Ah, okay. This sounds like a bug then. Please enter a wxWindows bug report about it, giving it a category of wxMSW specific and be sure to mention that it is the Unicode build.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Hi Rick-
  I just ran textctrltest.py. The problem with this program is not
locale/language or saving/opening its own files. It saves files
correctly without unusual characters. However, it can't open
_any_ file correctly--even a simple text file looks like a text
editor reading compiled byte code.
  So, isolate your problem further, and just try to ensure it
can open a file correctly first (assuming that textctrltest.py
accurately reflects the larger program, of course).

John

···

-----Original Message-----
From: Rick Zoerner [mailto:rick@zoerner.com]
Sent: 2004 01 20 12:37
To: WxPython-users (E-mail)
Subject: RE: [wxPython-users] What happened to my language?

> -----Original Message-----
> From: John Li [mailto:johnli@ahlt.net]
>
> If you put your previous code in a small runnable app I'll take
> a look at it--I'm no expert, but am looking at locale issues
> right now.

Thank you, John. I really appreciate you taking any time at
all to try and
look at this for me. I've noticed this is like proof-reading your own
report - I see what I want to see more often than what is
really there.

I'm sending this zip file with two things, actually. One is the small
(relatively), self-contained app that exhibits the problem.
The rest is the
whole app as I have it so far. The code I ended up with
trying to reduce it
was so ugly and twisted that while it does run, it may
actually be easier to
trace relationships in the actual app.

The file unzips to a directory <RZA>. The reduced example is called
"textctrltest.py" in the parent directory. The file to run
the whole app is
rza.py (or rzawin.pyw). Finally, the module from the app with
the wxTextCtrl
code in it is <RZA\base\Writer.py>.

Thanks, again.
-Rick Zoerner

> > -----Original Message-----
> > From: Rick Zoerner [mailto:rick@zoerner.com]
> > Sent: 2004 01 19 21:23
> > To: wxPython-users@lists.wxwindows.org
> > Subject: RE: [wxPython-users] What happened to my language?
> >
> >
> > I don't think I am explaining myself well enough. I
> apologize for the
> > confusion this is causing. Notepad should not even be a
part of the
> > equation. I only mentioned it at all to illustrate that the
> file being
> > written out *is* readable with any other text/ascii capable
> > editor. That's
> > as far as the Notepad thing goes.
> >
> > The problem is that I can save out a file
> > (wxTextCtrl.SaveFile) - then,
> > close the app. Then, open the app. Then, load the exact same
> > file using
> > wxTextCtrl.LoadFile... and get Chinese. No other interaction
> > was done or
> > wanted. The wxTextCtrl.Loadfile method is not able to read
> > and display the
> > exact file laid down by the wxTextCtrl.SaveFile method just a
> > few seconds
> > earlier. AFTER it fails to load I can try to look at the file
> > using NotePad
> > and see and load and work with it in Notepad just fine.
> >
> > That's why I think I must be missing something simple and
> obvious - it
> > doesn't make sense to me why the file can't be read back in.
> > I now have a
> > word processor that only works in one direction.
> >
> > I also created a file in Notepad (a large part of the goal is
> > to be able to
> > read in ANY text file) and saved it 4 times using each
> > file-type option
> > available in Notepad (ANSI, Unicode, unicode big endian,
> > UTF-8). I then
> > tried loading each of them, and none of them came in,
> either. The app
> > doesn't generate any error, but it just displays a blank page.
> >
> > Is there something I'm missing about declaring a particular
> > encoding or
> > something? I'm dead-in-the-water if I can't read the
files back in.
> >
> > Thanks, and I apologize if I'm being exceptionally dense
here about
> > anything.
> > -Rick Zoerner
> >
> > > -----Original Message-----
> > > From: Robin Dunn [mailto:robin@alldunn.com]
> > > Sent: Monday, January 19, 2004 4:04 PM
> > > To: wxPython-users@lists.wxwindows.org
> > > Subject: Re: [wxPython-users] What happened to my language?
> > >
> > >
> > > Rick Zoerner wrote:
> > > > John Li wrote:
> > > >
> > > >
> > > >>What language is 'my' language?
> > > >>What OS are you using; are you using a wxPython version that
> > > >>supports unicode?
> > > >>
> > > >>Chinese characters also may be displayed when a high-ascii
> > > >>character--such as letters with diacritics in French
or Swedish,
> > > >>for example--are used, and the wrong locale/character set is
> > > >>assumed.
> > > >>
> > > >>John
> > > >
> > > >
> > > > I'm sorry, I should have thought of that. I'm running
> > > Python 2.3/wxPython
> > > > 2.4.2.4u on WinXP in English. Yes, I believe I installed
> > > w/unicode support.
> > >
> > > In that case then you are probably writing out unicode
> > > (ucs-16 ?) text
> > > to the file, but Notepad is expecting 8-bit ascii. If you
> > > want to save
> > > something else then use textCtrl.GetValue() and convert
> the unicode
> > > string to whatever you want and then write that to a file
> yourself.
> > >
> > > --
> > > Robin Dunn
> > > Software Craftsman
> > > http://wxPython.org Java give you jitters? Relax with
wxPython!

O.K., I admit it - I must not be able to read. I went to wxWindows on
Sorceforge and to the bug page, but all I can figure out how to do is list
existing reports. How do I add a new one?

···

-----Original Message-----
From: Robin Dunn [mailto:robin@alldunn.com]
Sent: Tuesday, January 20, 2004 9:58 AM
To: wxPython-users@lists.wxwindows.org
Subject: Re: [wxPython-users] What happened to my language?

Ah, okay. This sounds like a bug then. Please enter a wxWindows bug
report about it, giving it a category of wxMSW specific and
be sure to
mention that it is the Unicode build.

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
For additional commands, e-mail:
wxPython-users-help@lists.wxwindows.org

Make sure to narrow down your problem further before submitting
a bug report!

···

-----Original Message-----
From: Rick Zoerner [mailto:rick@zoerner.com]
Sent: 2004 01 21 9:37
To: wxPython-users@lists.wxwindows.org
Subject: RE: [wxPython-users] What happened to my language?

O.K., I admit it - I must not be able to read. I went to wxWindows on
Sorceforge and to the bug page, but all I can figure out how
to do is list
existing reports. How do I add a new one?

> -----Original Message-----
> From: Robin Dunn [mailto:robin@alldunn.com]
> Sent: Tuesday, January 20, 2004 9:58 AM
> To: wxPython-users@lists.wxwindows.org
> Subject: Re: [wxPython-users] What happened to my language?
>
>
> Ah, okay. This sounds like a bug then. Please enter a
wxWindows bug
> report about it, giving it a category of wxMSW specific and
> be sure to
> mention that it is the Unicode build.
>
> --
> Robin Dunn
> Software Craftsman
> http://wxPython.org Java give you jitters? Relax with wxPython!
>
>
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
wxPython-users-unsubscribe@lists.wxwindows.org
> For additional commands, e-mail:
> wxPython-users-help@lists.wxwindows.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
For additional commands, e-mail:
wxPython-users-help@lists.wxwindows.org

When you are logged into SourceForge you can use the "Submit New" button
at the top of the list.

Markus

···

Am Mit, den 21.01.2004 schrieb Rick Zoerner um 15:36:

O.K., I admit it - I must not be able to read. I went to wxWindows on
Sorceforge and to the bug page, but all I can figure out how to do is list
existing reports. How do I add a new one?