Recent

Author Topic: UTF8 console line breaking  (Read 2021 times)

weq

  • New member
  • *
  • Posts: 6
UTF8 console line breaking
« on: January 24, 2014, 06:02:58 pm »
Hi
I have looked a bit on the forum (and google) but haven't found abything
The problem is - my console application user wrteinl() to print text i utf8:
Quote
To jest długi string z wieloma polskimi literami ąółżęś kodowany w UTF8,
żeby
było śmieszniej, haha.

These letters with dots etc. are polish regional letters.
The console is set (by default) in 80 columns, but when I print my string it breaks as in the quote but it should on "y" i "było".
It seems that for every special letter in string i have "blank" at the end of the line. It looks it chop string into 80chars parts and then reduce two-bytes utf8 code into one character.
what can i do about it?
Regards,

Zaqqen
PS. Teh system is Lubuntu with LXTerminal

taazz

  • Hero Member
  • *****
  • Posts: 5363
Re: UTF8 console line breaking
« Reply #1 on: January 24, 2014, 06:21:04 pm »
convert the utf8 string to ansi before writeln it.
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

weq

  • New member
  • *
  • Posts: 6
Re: UTF8 console line breaking
« Reply #2 on: January 24, 2014, 07:01:46 pm »
But then I lost my regional letters. Console is codeing in UTF8 - i'snt that stardard coding in linux terminals?

taazz

  • Hero Member
  • *****
  • Posts: 5363
Re: UTF8 console line breaking
« Reply #3 on: January 24, 2014, 07:03:35 pm »
ow linux, I missed that, sorry I don't use it that much and I do not know what peculiarities it has.
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64