* convert unicode/widestring constants to ansistring in resourcestring

declarations (mantis #25198)

git-svn-id: trunk@25807 -
This commit is contained in:
Jonas Maebe 2013-10-17 12:43:39 +00:00
parent 9be15583af
commit 8dd956cbde
3 changed files with 26 additions and 0 deletions

1
.gitattributes vendored
View File

@ -13621,6 +13621,7 @@ tests/webtbs/tw25077.pp svneol=native#text/pascal
tests/webtbs/tw25081.pp svneol=native#text/pascal
tests/webtbs/tw25101.pp svneol=native#text/pascal
tests/webtbs/tw2514.pp svneol=native#text/plain
tests/webtbs/tw25198.pp svneol=native#text/plain
tests/webtbs/tw2525.pp svneol=native#text/plain
tests/webtbs/tw2536.pp svneol=native#text/plain
tests/webtbs/tw2540.pp svneol=native#text/plain

View File

@ -956,6 +956,9 @@ implementation
stringconstn:
with Tstringconstnode(p) do
begin
{ resourcestrings are currently always single byte }
if cst_type in [cst_widestring,cst_unicodestring] then
changestringtype(getansistringdef);
getmem(sp,len+1);
move(value_str^,sp^,len+1);
sym:=tconstsym.create_string(orgname,constresourcestring,sp,len,nil);

22
tests/webtbs/tw25198.pp Normal file
View File

@ -0,0 +1,22 @@
program concatenate_resourestrings_delphiunicode;
{$mode delphiunicode}
{$codepage cp1250}
{$ifdef unix}
uses
cwstring;
{$endif}
resourcestring
res2 = 'žlu<6C>ouèký ' + 'koníèek';
type
tstr1250 = type ansistring(1250);
var
str1250: tstr1250;
begin
str1250 := 'žlu<6C>ouèký ' + 'koníèek';
if res2<>str1250 then
halt(1);
end.