Discussion:
"Value" chunk encoding in RSJ files
(too old to reply)
Maxim Ganetsky
2016-07-14 12:48:23 UTC
Permalink
Raw Message
Hello.

I noticed that in RSJ file when resource string has e.g. Cyrillic
symbols "Value" chunk doesn't seem to have UTF-16 encoding (but it
should according to comment in cresstr.pas).

Example for 'Тест' resource string (originally encoded in UTF-8):

{"version":1,"strings":[
{"hash":264409906,"name":"unit1.teststr","sourcebytes":[208,162,208,181,209,129,209,130],"value":"\u00D0\u00A2\u00D0\u00B5\u00D1\u0081\u00D1\u0082"}
]}

Unicode values seem to be just source bytes values converted to hex
representation.

I use FPC 3.0.0. Is it a bug or I don't understand something?
--
Best regards,
Maxim Ganetsky mailto:***@narod.ru
_______________________________________________
fpc-devel maillist - fpc-***@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/ma
Jonas Maebe
2016-07-14 13:13:00 UTC
Permalink
Raw Message
Post by Maxim Ganetsky
I noticed that in RSJ file when resource string has e.g. Cyrillic
symbols "Value" chunk doesn't seem to have UTF-16 encoding (but it
should according to comment in cresstr.pas).
Have you set the source file codepage? See
http://wiki.freepascal.org/FPC_Unicode_support#Source_file_codepage and
http://wiki.freepascal.org/FPC_Unicode_support#String_constants


Jonas
_______________________________________________
fpc-devel maillist - fpc-***@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
Mattias Gaertner
2016-07-14 13:05:22 UTC
Permalink
Raw Message
On Thu, 14 Jul 2016 15:48:23 +0300
Post by Maxim Ganetsky
Hello.
I noticed that in RSJ file when resource string has e.g. Cyrillic
symbols "Value" chunk doesn't seem to have UTF-16 encoding (but it
should according to comment in cresstr.pas).
Did you tell FPC that your source is encoded in is UTF-8?
Post by Maxim Ganetsky
{"version":1,"strings":[
{"hash":264409906,"name":"unit1.teststr","sourcebytes":[208,162,208,181,209,129,209,130],"value":"\u00D0\u00A2\u00D0\u00B5\u00D1\u0081\u00D1\u0082"}
]}
Unicode values seem to be just source bytes values converted to hex
representation.
I use FPC 3.0.0. Is it a bug or I don't understand something?
Mattias

_______________________________________________
fpc-devel maillist - fpc-***@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listi
Maxim Ganetsky
2016-07-14 13:32:58 UTC
Permalink
Raw Message
Post by Mattias Gaertner
On Thu, 14 Jul 2016 15:48:23 +0300
Post by Maxim Ganetsky
Hello.
I noticed that in RSJ file when resource string has e.g. Cyrillic
symbols "Value" chunk doesn't seem to have UTF-16 encoding (but it
should according to comment in cresstr.pas).
Did you tell FPC that your source is encoded in is UTF-8?
I created standard Lazarus application, so? I guess, no.

The main question is that we need to generate RSJ-compatible output
ourselves from IDE. What should we write to this chunk then?
Post by Mattias Gaertner
Post by Maxim Ganetsky
{"version":1,"strings":[
{"hash":264409906,"name":"unit1.teststr","sourcebytes":[208,162,208,181,209,129,209,130],"value":"\u00D0\u00A2\u00D0\u00B5\u00D1\u0081\u00D1\u0082"}
]}
Unicode values seem to be just source bytes values converted to hex
representation.
I use FPC 3.0.0. Is it a bug or I don't understand something?
--
Best regards,
Maxim Ganetsky mailto:***@narod.ru
_______________________________________________
fpc-devel maillist - fpc-***@lists.freepascal.org
http://lists.
Mattias Gaertner
2016-07-14 13:49:49 UTC
Permalink
Raw Message
On Thu, 14 Jul 2016 16:32:58 +0300
Post by Maxim Ganetsky
Post by Mattias Gaertner
On Thu, 14 Jul 2016 15:48:23 +0300
Post by Maxim Ganetsky
Hello.
I noticed that in RSJ file when resource string has e.g. Cyrillic
symbols "Value" chunk doesn't seem to have UTF-16 encoding (but it
should according to comment in cresstr.pas).
Did you tell FPC that your source is encoded in is UTF-8?
I created standard Lazarus application, so? I guess, no.
The main question is that we need to generate RSJ-compatible output
ourselves from IDE. What should we write to this chunk then?
UTF-16.

Mattias
_______________________________________________
fpc-devel maillist - fpc-***@lists.freepascal.org
http://lists.freep
Maxim Ganetsky
2016-07-14 21:05:06 UTC
Permalink
Raw Message
Post by Mattias Gaertner
On Thu, 14 Jul 2016 16:32:58 +0300
Post by Maxim Ganetsky
Post by Mattias Gaertner
On Thu, 14 Jul 2016 15:48:23 +0300
Post by Maxim Ganetsky
Hello.
I noticed that in RSJ file when resource string has e.g. Cyrillic
symbols "Value" chunk doesn't seem to have UTF-16 encoding (but it
should according to comment in cresstr.pas).
Did you tell FPC that your source is encoded in is UTF-8?
I created standard Lazarus application, so? I guess, no.
The main question is that we need to generate RSJ-compatible output
ourselves from IDE. What should we write to this chunk then?
UTF-16.
Done in r52688.
--
Best regards,
Maxim Ganetsky mailto:***@narod.ru
_______________________________________________
fpc-devel maillist - fpc-***@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/f
Loading...