Recent

Author Topic: UTF-8  (Read 12364 times)

Never

  • Sr. Member
  • ****
  • Posts: 409
  • OS:Win7 64bit / Lazarus 1.4
Re: UTF-8
« Reply #15 on: November 30, 2014, 10:55:58 pm »
fund them in CT  fpc sources
and here is the result
Νέπε Λάζαρε λάγγεψων οξωκά ο φίλοσ'ς αραεύσε

engkin

  • Hero Member
  • *****
  • Posts: 3112
Re: UTF-8
« Reply #16 on: December 01, 2014, 12:18:30 am »
@Never
Baltas99's system is using Russian CP,
Your system is using Greek CP
The image you posted above shows that FPC is converting UTF8 string to your Greek CP.
The other day Marco mentioned DefaultSystemCodePage.
I assume DefaultSystemCodePage on your system is 737.

If you add:
Code: [Select]
  DefaultSystemCodePage := CP_UTF8;
to the previous code it should work. Can you try?


Never

  • Sr. Member
  • ****
  • Posts: 409
  • OS:Win7 64bit / Lazarus 1.4
Re: UTF-8
« Reply #17 on: December 01, 2014, 12:25:47 am »
i test it with CT and faild

but 
Code: [Select]
DefaultSystemCodePage ; is not avaliable with lazarus
Νέπε Λάζαρε λάγγεψων οξωκά ο φίλοσ'ς αραεύσε

engkin

  • Hero Member
  • *****
  • Posts: 3112
Re: UTF-8
« Reply #18 on: December 01, 2014, 06:22:41 pm »
@Never, What font did you use in your last two images you posted?
On my system:
when I use raster font the zero has a slash, as in my first attachment.
when I use Lucida Console font there is no slash, as in my second attachement.

baltas99

  • Newbie
  • Posts: 5
Re: UTF-8
« Reply #19 on: December 04, 2014, 03:07:58 pm »
@Never
Baltas99's system is using Russian CP,
Your system is using Greek CP
The image you posted above shows that FPC is converting UTF8 string to your Greek CP.
The other day Marco mentioned DefaultSystemCodePage.
I assume DefaultSystemCodePage on your system is 737.

If you add:
Code: [Select]
  DefaultSystemCodePage := CP_UTF8;
to the previous code it should work. Can you try?
Thank you but why i have an Error:Identifier not found "GetTextCodePage".Do i have to add an reqirment to project inspector?

baltas99

  • Newbie
  • Posts: 5
Re: UTF-8
« Reply #20 on: December 04, 2014, 03:16:38 pm »
@Never
Baltas99's system is using Russian CP,
Your system is using Greek CP
The image you posted above shows that FPC is converting UTF8 string to your Greek CP.
The other day Marco mentioned DefaultSystemCodePage.
I assume DefaultSystemCodePage on your system is 737.

If you add:
Code: [Select]
  DefaultSystemCodePage := CP_UTF8;
to the previous code it should work. Can you try?
Thank you but why i have an Error:Identifier not found "GetTextCodePage".Do i have to add an reqirment to project inspector?
It finally worked by just writing Writeln(UTF8ToConsole('Τα δεδομενα που εισαγατε ειναι λανθασμενα.')); when i chaneged my lanuage for non unicode programmes to greek.

Never

  • Sr. Member
  • ****
  • Posts: 409
  • OS:Win7 64bit / Lazarus 1.4
Re: UTF-8
« Reply #21 on: December 04, 2014, 05:37:46 pm »
@baltas99 glad you made it
@engkin
excuse me i didn't see your response earlier
Quote
@Never, What font did you use in your last two images you posted?
i can't remember which one is in the picture but none of them was working
the pictures are a screenshot of the last i tried.
Usually i try fonts in the console from top to bottom so most probably is to be raster
if this is important i can dig to re-execute
Νέπε Λάζαρε λάγγεψων οξωκά ο φίλοσ'ς αραεύσε

engkin

  • Hero Member
  • *****
  • Posts: 3112
Re: UTF-8
« Reply #22 on: December 04, 2014, 10:02:39 pm »
@Never,  :) it's ok. I think we are done with this thread for now.

@baltas99 Well done, just be aware that you can't mix languages if you stick to ANSI solution.

 

TinyPortal © 2005-2018