Recent

Author Topic: [HELP!!] - Pacal - Displaying Unicode [Showing UTF8 in console pascal]  (Read 26783 times)

nobodyknowsme

  • Full Member
  • ***
  • Posts: 114
(http://screenshu.com/static/uploads/temporary/vz/06/9v/2xp1py.jpg)

http://screenshu.com/static/uploads/temporary/vz/06/9v/2xp1py.jpg

How can I fix this? I need this to work. I don't want to use Ascii art. I just want this symbol to work.
« Last Edit: November 24, 2014, 09:09:23 pm by nobodyknowsme »

howardpc

  • Hero Member
  • *****
  • Posts: 4144
Re: HELP - Pacal - Displaying Unicode [Showing UTF8 in console pascal]
« Reply #1 on: November 24, 2014, 08:57:55 pm »
You don't mention your OS, but it could be that the default font on your terminal/console is not able to display the same characters/symbols that your screen font does, or that the console does not correctly take account of the encoding used for the string you display (which if it is a screenshot of Lazarus would be utf8).
First step to try would be to change the font used by the console.

nobodyknowsme

  • Full Member
  • ***
  • Posts: 114
Re: HELP - Pacal - Displaying Unicode [Showing UTF8 in console pascal]
« Reply #2 on: November 24, 2014, 09:01:56 pm »
How would I change the font of the console? Also when I execute this will it stay the same? As I am going to show this to my teacher and send her the file. How do I change the console font?

nobodyknowsme

  • Full Member
  • ***
  • Posts: 114
Re: HELP - Pacal - Displaying Unicode [Showing UTF8 in console pascal]
« Reply #3 on: November 24, 2014, 09:02:49 pm »
I am using Windows 7. Also I don't think it is the font. Do I not need to convert it to something it can read?
« Last Edit: November 24, 2014, 09:04:48 pm by nobodyknowsme »

eny

  • Hero Member
  • *****
  • Posts: 1648
Re: [HELP!!] - Pacal - Displaying Unicode [Showing UTF8 in console pascal]
« Reply #4 on: November 24, 2014, 09:59:30 pm »
I have a deja vu
All posts based on: Win10 (Win64); Lazarus 3_4  (x64) 25-05-2024 (unless specified otherwise...)

nobodyknowsme

  • Full Member
  • ***
  • Posts: 114
Re: [HELP!!] - Pacal - Displaying Unicode [Showing UTF8 in console pascal]
« Reply #5 on: November 24, 2014, 10:01:46 pm »
What a deja vu? What? Do you know how to fix it?

CM630

  • Hero Member
  • *****
  • Posts: 1579
  • Не съм сигурен, че те разбирам.
    • http://sourceforge.net/u/cm630/profile/
Re: [HELP!!] - Pacal - Displaying Unicode [Showing UTF8 in console pascal]
« Reply #6 on: November 24, 2014, 10:04:28 pm »
I suppose you have to find a ASCII codepage, that supports these hearts.
And then maybe you should do something like
Code: [Select]
uses ....LConvEncoding'...
.....writeln(UTF8toCPxxx(yourtext));
 
And this should be a Windows only solution, IMHO Linux goes fine with unicode in console.
« Last Edit: November 24, 2014, 10:07:01 pm by paskal »
Лазар 4,4 32 bit (sometimes 64 bit); FPC3,2,2

nobodyknowsme

  • Full Member
  • ***
  • Posts: 114
Re: [HELP!!] - Pacal - Displaying Unicode [Showing UTF8 in console pascal]
« Reply #7 on: November 24, 2014, 10:06:28 pm »
writeln(UTF8toCPxxx(yourtext));

Whats the CP and xxx mean? Could you please give me an example of something? Just any character. Or a webpage to the Ascii characters

nobodyknowsme

  • Full Member
  • ***
  • Posts: 114
Re: [HELP!!] - Pacal - Displaying Unicode [Showing UTF8 in console pascal]
« Reply #8 on: November 24, 2014, 10:08:11 pm »
writeln(UTF8toCPxxx(yourtext));

Whats the CP and xxx mean? Could you please give me an example of something? Just any character. Or a webpage to the Ascii characters

http://screenshu.com/static/uploads/temporary/zu/j3/r7/6oevg5.jpg

It doesn't work. What does the CPxxx mean? Its saying its not a identifier

nobodyknowsme

  • Full Member
  • ***
  • Posts: 114
Re: [HELP!!] - Pacal - Displaying Unicode [Showing UTF8 in console pascal]
« Reply #9 on: November 24, 2014, 10:09:44 pm »
writeln(UTF8toCPxxx(yourtext));

Whats the CP and xxx mean? Could you please give me an example of something? Just any character. Or a webpage to the Ascii characters

http://screenshu.com/static/uploads/temporary/p2/c0/bn/oykwae.jpg

It doesn't work either. That uses doesn't allow me,

nobodyknowsme

  • Full Member
  • ***
  • Posts: 114
Re: [HELP!!] - Pacal - Displaying Unicode [Showing UTF8 in console pascal]
« Reply #10 on: November 24, 2014, 10:11:46 pm »
writeln(UTF8toCPxxx(yourtext));

Whats the CP and xxx mean? Could you please give me an example of something? Just any character. Or a webpage to the Ascii characters

Sorry to pester. But it doesn't recognize the uses at all. Any ideas?

http://screenshu.com/static/uploads/temporary/p2/c0/bn/oykwae.jpg
http://screenshu.com/static/uploads/temporary/zu/j3/r7/6oevg5.jpg

eny

  • Hero Member
  • *****
  • Posts: 1648
Re: [HELP!!] - Pacal - Displaying Unicode [Showing UTF8 in console pascal]
« Reply #11 on: November 24, 2014, 10:18:29 pm »
4 replies to self in 5 minutes.... surely the answer will follow soon now  :(
All posts based on: Win10 (Win64); Lazarus 3_4  (x64) 25-05-2024 (unless specified otherwise...)

nobodyknowsme

  • Full Member
  • ***
  • Posts: 114
Re: [HELP!!] - Pacal - Displaying Unicode [Showing UTF8 in console pascal]
« Reply #12 on: November 24, 2014, 10:20:22 pm »
I know, I really need this to be figured out soon! :)

CM630

  • Hero Member
  • *****
  • Posts: 1579
  • Не съм сигурен, че те разбирам.
    • http://sourceforge.net/u/cm630/profile/
Re: [HELP!!] - Pacal - Displaying Unicode [Showing UTF8 in console pascal]
« Reply #13 on: November 24, 2014, 10:24:11 pm »
Here is info what a codepage is.
This is a 8 bit character table, used before unicode.
Windows console does not understand unicode. So you have to select a codepage, containing the character you want.
And by the way, I seriously doubt that showing Cyrillic, Latin and Greek characters at the same time in the Windows console is possible.
Лазар 4,4 32 bit (sometimes 64 bit); FPC3,2,2

nobodyknowsme

  • Full Member
  • ***
  • Posts: 114
Re: [HELP!!] - Pacal - Displaying Unicode [Showing UTF8 in console pascal]
« Reply #14 on: November 24, 2014, 10:29:50 pm »
http://screenshu.com/static/uploads/temporary/p2/c0/bn/oykwae.jpg
http://screenshu.com/static/uploads/temporary/zu/j3/r7/6oevg5.jpg

uses ....LConvEncoding'...
.....writeln(UTF8toCPxxx(yourtext));

The LConvEncoding uses doesn't work. Could you possibly make a simple program with the love heart symbol in? I would even pay you to do it if you can get the love heart in a console application. Can be any love heart symbol in a console application?

 

TinyPortal © 2005-2018