Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2008-10

MacOSAll.pas has invalid UTF-8 characters

9 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Graeme Geldenhuys

Hi,

From what I can gather the following unit seems to have invalid UTF-8 characters

<fpc>/packages/univint/src/MacOSAll.pas

It's easily noticeable using an editor like KWrite or gEdit. KWrite make them easier to spot, by showing a black circle with white '?' inside. Lazarus and gEdit shows them as the letter A with a small circle on the top. Is that unit meant to be like that?

eg;
  line 169, 174, 182 etc... all contain those odd characters.

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Reply by email

Graeme Geldenhuys
to Florian Klaempfl
Florian Klaempfl wrote 5 lines
> >>From what I can gather the following unit seems to have invalid UTF-8 characters > <fpc>/packages/univint/src/MacOSAll.pas What makes you think the file is utf-8 encoded?

Because Martin Schreiber said so. ;-) I noticed an issue with his MSEide project not being able to open that file. He reported that it's an invalid UTF-8 sequence causing the problem. So I assumed the file is utf-8 encoded.

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Reply by email

Mattias Gaertner
to Graeme Geldenhuys
Show quoted text 14 lines
On Wed, Oct 22, 2008 at 1:57 PM, Florian Klaempfl wrote: >> >>>From what I can gather the following unit seems to have invalid >>>UTF-8 characters >> <fpc>/packages/univint/src/MacOSAll.pas > > What makes you think the file is utf-8 encoded? Because Martin Schreiber said so. ;-) I noticed an issue with his MSEide project not being able to open that file. He reported that it's an invalid UTF-8 sequence causing the problem. So I assumed the file is utf-8 encoded.

AFAIK the original c header files are UTF-8 encoded. Maybe the translation utility did some conversion.

Lazarus opens it as ISO-8859-1, which allows even some basic editing without loosing/destroying data.

Mattias

Reply by email

Graeme Geldenhuys
to Mattias Gaertner
Mattias Gaertner wrote
AFAIK the original c header files are UTF-8 encoded. Maybe the translation utility did some conversion.

That's probably what happened then.

Lazarus opens it as ISO-8859-1, which allows even some basic editing without loosing/destroying data.

Most editors don't have issues opening that file, but if you browse it you can see the odd characters (quite a few) that seems out of place. "kwrite" makes them easy to spot - it highlights them with a ? on a black circle. In Lazarus IDE they mostly appear as a 'A' character with a small circle above it. I don't believe that was in the original C header file.

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Reply by email

Graeme Geldenhuys
to Graeme Geldenhuys: <fpc>/packages/univint/src/MacOSAll.pas It's easily noticeable using an editor like…
Graeme Geldenhuys wrote
Hi, From what I can gather the following unit seems to have invalid UTF-8 characters <fpc>/packages/univint/src/MacOSAll.pas

I only noticed now... I posted this in the wrong mailing list. It was meant for the FPC-Devel list. Sorry for the noise.

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Reply by email

JoshyFun
to Graeme Geldenhuys: On Thu, Oct 23, 2008 at 12:48 AM, Mattias Gaertner That's probably what happened then.…

Hello Graeme,

Thursday, October 23, 2008, 9:24:30 AM, you wrote:

GG> Most editors don't have issues opening that file, but if you browse it GG> you can see the odd characters (quite a few) that seems out of place. GG> "kwrite" makes them easy to spot - it highlights them with a ? on a GG> black circle. In Lazarus IDE they mostly appear as a 'A' character GG> with a small circle above it. I don't believe that was in the original GG> C header file.

That character ($C5) seens to be some kind of mask character in MacOS, and it is being used in the comments as just a mask, replacing it by '*' will clarify the meaning (something like)

----------------
API_CALL_*_*
First piece is the function name, second one the encoding. ----------------

Using * you will interpret it correctly ;)

Best regards, JoshyFun

Reply by email

Mattias Gaertner
to JoshyFun
Show quoted text 21 lines
Hello Graeme, Thursday, October 23, 2008, 9:24:30 AM, you wrote: GG> Most editors don't have issues opening that file, but if you GG> browse it you can see the odd characters (quite a few) that seems GG> out of place. "kwrite" makes them easy to spot - it highlights GG> them with a ? on a black circle. In Lazarus IDE they mostly GG> appear as a 'A' character with a small circle above it. I don't GG> believe that was in the original C header file. That character ($C5) seens to be some kind of mask character in MacOS, and it is being used in the comments as just a mask, replacing it by '*' will clarify the meaning (something like) ---------------- API_CALL_*_* First piece is the function name, second one the encoding. ---------------- Using * you will interpret it correctly ;)

Yes, please put this on the fpc bug tracker.

Mattias

Reply by email

Graeme Geldenhuys
to Mattias Gaertner
Mattias Gaertner wrote 12 lines
> That character ($C5) seens to be some kind of mask character in MacOS, > and it is being used in the comments as just a mask, replacing it by > '*' will clarify the meaning (something like) > > ---------------- > API_CALL_*_* > First piece is the function name, second one the encoding. > ---------------- > > Using * you will interpret it correctly ;) Yes, please put this on the fpc bug tracker.

OK. Reported as follows:
http://bugs.freepascal.org/view.php?id=12474

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Reply by email