View Issue Details

IDProjectCategoryView StatusLast Update
0036078LazarusLazUtilspublic2020-07-24 13:18
ReporterCudaText man Assigned ToJuha Manninen  
PrioritynormalSeverityminorReproducibilityN/A
Status resolvedResolutionreopened 
Product Version2.1 (SVN) 
Summary0036078: Wish: split arrays (encoding pages) from LConvEncoding to .inc file
DescriptionLConvEncoding unit has many arrays (encoding tables):

const
  ArrayISO_8859_1ToUTF8: TCharToUTF8Table = (
  ArrayISO_8859_15ToUTF8: TCharToUTF8Table = (
  ArrayISO_8859_2ToUTF8: TCharToUTF8Table = (
  ArrayCP1250ToUTF8: TCharToUTF8Table = (
  ArrayCP1251ToUTF8: TCharToUTF8Table = (
  ArrayCP1252ToUTF8: TCharToUTF8Table = (
  ArrayCP1253ToUTF8: TCharToUTF8Table = (
  ArrayCP1254ToUTF8: TCharToUTF8Table = (
  ArrayCP1255ToUTF8: TCharToUTF8Table = (
  ArrayCP1256ToUTF8: TCharToUTF8Table = (
  ArrayCP1257ToUTF8: TCharToUTF8Table = (
  ArrayCP1258ToUTF8: TCharToUTF8Table = (
  ArrayCP437ToUTF8 : TCharToUTF8Table = (
  ArrayCP850ToUTF8 : TCharToUTF8Table = (
  ArrayCP852ToUTF8 : TCharToUTF8Table = (
  ArrayCP866ToUTF8 : TCharToUTF8Table = (
  ArrayCP874ToUTF8: TCharToUTF8Table = (
  ArrayKOI8ToUTF8: TCharToUTF8Table = (
  ArrayMacintoshToUTF8: TCharToUTF8Table = (

they are big part of the unut. We have separate asian tables in the asiancodepages.inc, so my wish is to split all those tables to .inc file too. Suggested name is commoncodepages.inc (or isocodepages.inc + commoncodepages.inc).

I write some library and it's good to have .inc file for me. Otherwise I need big copy/paste (and code duplication with LazUtils).

TagsNo tags attached.
Fixed in Revisionr61971, r63642
LazTarget-
Widgetset
Attached Files

Relationships

related to 0037155 resolvedJuha Manninen Patches LConvEncoding miss KOI8-R characters 

Activities

Juha Manninen

2019-10-03 20:47

developer   ~0118294

Yes, fair enough. Done.

CudaText man

2019-10-03 21:08

reporter   ~0118295

Last edited: 2019-10-03 21:14

View 5 revisions

Thanks.
Can we make "next step"?
1) Rework 2 files asiancodepages.inc / commoncodpages.inc to UNITS - with better names too - CodepagesAsian, CodepagesCommon. These units will have all those arrays in Interface.
1b) Put there also these functions:
https://github.com/Alexey-T/EncConv/blob/master/encconv/encconv_commoncodepagefunctions.inc
(URL shows functions from LazUtils)
2) Add new units to LazUtils LPK.

Why?
My library https://github.com/alexey-t/EncConv today makes 200K overhead (duplicated arrays with LazUtils).

Juha Manninen

2019-10-03 22:08

developer   ~0118297

> My library https://github.com/alexey-t/EncConv today makes 200K overhead (duplicated arrays with LazUtils).

I thought the .inc file would help with that.
Why do you need your own conversion funcs? If functions are missing from LConvEncoding or if they are buggy, they should be added/fixed instead.

CudaText man

2019-10-04 14:48

reporter   ~0118322

Own funcs? I made changes to LazUtils conv funcs, see
https://github.com/Alexey-T/EncConv/blob/master/readme.txt

Why units are needed? you know, my code cannot find LazUtils .inc file. If it can, data (codepage arrays) in .inc files will be duplicated in exe (LazUtils uses this .inc file too).

Juha Manninen

2020-07-12 11:05

developer   ~0123918

@CudaText man, in the related issue you wrote :
> I added this patch to EncConv package and used/added KOI8* codepages to CudaText 1.105 (so you can test the work of this patch)

I assume it is related to this one. I still think you changed the code just for the sake of changing. If the provided encoding functions are buggy or miss features, we can fix and improve them. Please give a clear example of what does not work.

CudaText man

2020-07-12 16:29

reporter   ~0123933

Last edited: 2020-07-12 16:30

View 2 revisions

Juha
currently all works OK.
The subj of this topic - split arrays of encodings to separate .inc file.
Now I think that .inc file is not good, coz if my app will use this .inc file, its data will be duplicated (200K arrays).
So now I want that the arrays be moved to UNIT, separate unit.
LConvEncoding will use this unit, and my app too. If I make the patch, it will be ok?

Juha Manninen

2020-07-12 17:07

developer   ~0123935

I still wonder, why do you need your own unit for the same task that LConvEncoding already does? I saw your list of changes. There were no bug fixes. Bugs in LConvEncoding should be fixed but I don't know of any.
So why not use LConvEncoding?

CudaText man

2020-07-12 18:45

reporter   ~0123938

I wrote EncConv, to make simpler API-- now I have enum with all encodings, and using this enum I run conv-encoding code faster (LConvEncoding uses STRING enc name, EncConv uses enum)
And EncConv strips many IFDEFs.

Juha Manninen

2020-07-22 19:39

developer   ~0124234

> If I make the patch, it will be ok?

I guess it is ok. It seems to be important for you.

CudaText man

2020-07-23 12:05

reporter   ~0124262

Added the patch, it now exposes arrays (from 2 inc files) via 2 new units.
version 3.
p3.zip (2,146 bytes)

Juha Manninen

2020-07-23 23:47

developer   ~0124291

Should the new units CodePagesCommon and CodePagesAsian be included in LazUtils package?
I can see you created the fpmake.pp file while they were included.
I can add them if needed. No need for an extra patch.

CudaText man

2020-07-24 11:04

reporter   ~0124300

yes, 2 units must be added to the package. (programs will use them).

Juha Manninen

2020-07-24 13:18

developer   ~0124303

Ok. Applied, thanks.

Issue History

Date Modified Username Field Change
2019-09-15 19:43 CudaText man New Issue
2019-10-03 20:44 Juha Manninen Assigned To => Juha Manninen
2019-10-03 20:44 Juha Manninen Status new => assigned
2019-10-03 20:47 Juha Manninen Status assigned => resolved
2019-10-03 20:47 Juha Manninen Resolution open => fixed
2019-10-03 20:47 Juha Manninen Fixed in Revision => r61971
2019-10-03 20:47 Juha Manninen LazTarget => -
2019-10-03 20:47 Juha Manninen Note Added: 0118294
2019-10-03 21:08 CudaText man Status resolved => assigned
2019-10-03 21:08 CudaText man Resolution fixed => reopened
2019-10-03 21:08 CudaText man Note Added: 0118295
2019-10-03 21:11 CudaText man Note Edited: 0118295 View Revisions
2019-10-03 21:12 CudaText man Note Edited: 0118295 View Revisions
2019-10-03 21:13 CudaText man Note Edited: 0118295 View Revisions
2019-10-03 21:14 CudaText man Note Edited: 0118295 View Revisions
2019-10-03 22:08 Juha Manninen Note Added: 0118297
2019-10-04 14:48 CudaText man Note Added: 0118322
2020-07-12 10:58 Juha Manninen Relationship added related to 0037155
2020-07-12 11:05 Juha Manninen Note Added: 0123918
2020-07-12 16:29 CudaText man Note Added: 0123933
2020-07-12 16:30 CudaText man Note Edited: 0123933 View Revisions
2020-07-12 17:07 Juha Manninen Note Added: 0123935
2020-07-12 18:45 CudaText man Note Added: 0123938
2020-07-22 19:39 Juha Manninen Note Added: 0124234
2020-07-23 12:05 CudaText man Note Added: 0124262
2020-07-23 12:05 CudaText man File Added: p3.zip
2020-07-23 23:47 Juha Manninen Status assigned => feedback
2020-07-23 23:47 Juha Manninen Note Added: 0124291
2020-07-24 11:04 CudaText man Note Added: 0124300
2020-07-24 11:04 CudaText man Status feedback => assigned
2020-07-24 13:18 Juha Manninen Status assigned => resolved
2020-07-24 13:18 Juha Manninen Fixed in Revision r61971 => r61971, r63642
2020-07-24 13:18 Juha Manninen Note Added: 0124303