Recent

Author Topic: Input a chinese in IDE,but only display half in code editer  (Read 16278 times)

sunstone

  • Newbie
  • Posts: 2
Input a chinese in IDE,but only display half in code editer
« on: January 23, 2009, 11:08:52 am »
Hi,
I input a chinese in code editer,but I found that it only display half a chinese. A chinese must include two chars,only the first char displayed.

for example :
showmessage('hello word');//你

the char 你 only display half,how to display the whole chinese?

system: win xp chinese
lazarus:0.926
« Last Edit: January 23, 2009, 11:10:38 am by sunstone »

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9210
  • Debugger - SynEdit - and more
    • wiki
Re: Input a chinese in IDE,but only display half in code editer
« Reply #1 on: January 24, 2009, 12:54:34 am »
Hi,

unfortunately this is a known issue. There is not yet a solution for it in near time.

However a workaround/hack is attached to the following issue
http://bugs.freepascal.org/view.php?id=11819


sunstone

  • Newbie
  • Posts: 2
Re: Input a chinese in IDE,but only display half in code editer
« Reply #2 on: January 24, 2009, 01:56:20 am »
 :( :'(unfortunately,this problem is't still solved now.I found the reason comes from SYNEDIT.

So,it is necessary to solve it as soon as possible.Development of Lazarus deeply affected by this problem in Asia,I think.

I really wish Lazarus having a happy future!I will try my best to do anything for Lazarus.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9210
  • Debugger - SynEdit - and more
    • wiki
Re: Input a chinese in IDE,but only display half in code editer
« Reply #3 on: January 24, 2009, 04:18:57 pm »
Which part did not work?

1) Where you able to apply the patch / Compile Lazarus with the patch applied?

2) Did you compile with "-d DoubleChrWidthHack"
OR remove the $IFDEF from the patch?


which version are you using?
a) 0.9.26
b) daily snapshot (which revision / date)
c) SVN checkout

rabbit

  • New Member
  • *
  • Posts: 11
Re: Input a chinese in IDE,but only display half in code editer
« Reply #4 on: January 25, 2009, 02:35:08 pm »
  The problem happened in version 0.9.26,and in version 0.9.24 this isn't a problem.
  But I found another problem:in version 0.9.24,if you put a component that has the dragkind property into the form,when you run your compiled appliction and click on the component,there would be an error:'divided by zero.'this time it isn't a problem in version 0.9.26.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9210
  • Debugger - SynEdit - and more
    • wiki
A fix has been applied to SVN.

This should be available in tomorrows Daily-Snapshot.
(Snapshot from 12th Feb 2009 or later)

If anyone still has some Chars half painted only, or any other issue with the fix:
Please provide feedback at
http://bugs.freepascal.org/view.php?id=11819 (or open a new bug, if this one has been closed)

If you have Chars being cut off, please provide the UTF-8 Code for those Chars. Thanks

« Last Edit: February 11, 2009, 01:41:15 am by Martin_fr »

Vincent Snijders

  • Administrator
  • Hero Member
  • *
  • Posts: 2661
    • My Lazarus wiki user page
Re: Input a chinese in IDE,but only display half in code editer
« Reply #6 on: February 11, 2009, 09:47:43 am »
The revision number is part of the snapshot file name. If Martin give the revision number in which the fix was committed, it should be possible to see if it is in the 11 February's snapshot or not.

Ñuño_Martínez

  • Hero Member
  • *****
  • Posts: 1186
    • Burdjia
Re: Input a chinese in IDE,but only display half in code editer
« Reply #7 on: February 11, 2009, 10:57:29 am »
So,it is necessary to solve it as soon as possible.Development of Lazarus deeply affected by this problem in Asia,I think.
Not only for Asia. A lot of other countries are affected. I.e. I'm Spanish and when I write:
Code: [Select]
{ Índice de la canción. } I get
Code: [Select]
{ 'Indice de la canci'on. } Anyway, Synedit is able to render UNICODE characters. I know it because I've opened sources created by gVim using UTF-8 and there's no problem with them.
« Last Edit: February 11, 2009, 10:59:57 am by Ñuño_Martínez »
Are you interested in game programming? Join the Pascal Game Development community!
Also visit the Game Development Portal

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9210
  • Debugger - SynEdit - and more
    • wiki
Re: Input a chinese in IDE,but only display half in code editer
« Reply #8 on: February 11, 2009, 01:23:19 pm »
The revision is 18633, and it is (will be) only included on the 12th.

@Ñuño_Martínez:

What you describe is a slightly different bug. Please open a new bug on mantis, and provide/attach a sample file containing such text.
- Maybe also provide the key sequence needed to type such text
- Which OS?

What you are experiencing is, that in UTF8 a single char (such as an accented, umlauted or similar char) can be stored as a sequence of 2 CodePoints.
In that case Lazarus would display the char and an empty space behind the char. (Actually the empty/space would display at the end of the highlight token/ at the next change of color/style)

The fact that you get 2 chars displayed, may also indicate that there is a bug with the input, and that Lazarus stores the wrong text. (in which case the display would be right)

Can you please test: Use another (UTF8 capable) Editor, Edit you text and put the desired ó there, save it, open it in Lazarus, and see what the result is?

Thanks
« Last Edit: February 11, 2009, 01:26:35 pm by Martin_fr »

theo

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1923
Re: Input a chinese in IDE,but only display half in code editer
« Reply #9 on: February 11, 2009, 01:54:48 pm »
I think Ñuño's problem is different and has to do with dead keys : http://bugs.freepascal.org/view.php?id=9755

Vincent Snijders

  • Administrator
  • Hero Member
  • *
  • Posts: 2661
    • My Lazarus wiki user page
Re: Input a chinese in IDE,but only display half in code editer
« Reply #10 on: February 11, 2009, 01:58:27 pm »
The revision is 18633, and it is (will be) only included on the 12th.

I disagree. All snapshots on http://www.hu.freepascal.org/lazarus/ have r18633 or later.

Ñuño_Martínez

  • Hero Member
  • *****
  • Posts: 1186
    • Burdjia
Re: Input a chinese in IDE,but only display half in code editer
« Reply #11 on: February 13, 2009, 01:13:52 pm »
(...)
- Maybe also provide the key sequence needed to type such text
- Which OS?
(...)
Can you please test: Use another (UTF8 capable) Editor, Edit you text and put the desired ó there, save it, open it in Lazarus, and see what the result is?
The key sequence is [acute] then [vocal]. I've used Windows and Linux both with same problem.

I use gVim a lot, even to edit Pascal sources, and I save files using UTF8. Lazarus loads and renders all these files correctly.

I think Ñuño's problem is different and has to do with dead keys : http://bugs.freepascal.org/view.php?id=9755
Not sure if it's the same bug. I'll see it carefully when I back home on Wednesdey, then I'll open a bug if necessary.
« Last Edit: February 13, 2009, 01:16:27 pm by Ñuño_Martínez »
Are you interested in game programming? Join the Pascal Game Development community!
Also visit the Game Development Portal

theo

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1923
Re: Input a chinese in IDE,but only display half in code editer
« Reply #12 on: February 13, 2009, 02:38:20 pm »
I'll see it carefully when I back home on Wednesdey, then I'll open a bug if necessary.

Maybe your case is already reported.
Check this and relationsships: http://bugs.freepascal.org/view.php?id=7742

Ñuño_Martínez

  • Hero Member
  • *****
  • Posts: 1186
    • Burdjia
Re: Input a chinese in IDE,but only display half in code editer
« Reply #13 on: February 19, 2009, 12:48:01 pm »
Maybe your case is already reported.
Check this and relationsships: http://bugs.freepascal.org/view.php?id=7742

Yes: that's the bug.
Are you interested in game programming? Join the Pascal Game Development community!
Also visit the Game Development Portal

 

TinyPortal © 2005-2018