Customer section

Forum index » Precision Builder Express » utf-8 without bom

ouiouioui

Number of posts: 15
Rank: User

Profile of user
Response

Posted: 19.01.2019 [17:28]

Hello,

I need write file in utf-8 without bom for use after on a website with PHP and PHP don't like BOM.
Actually i use ltrim($str, "\\xef\\xbb\\xbf"); in my PHP script.

in pbe i use scripting for write my file with:
SaveStrToFileEx(jsonValue, ProjectVars.Values['JSONFILE'], 'utf-8');
i tried utf-8nobom, utf8nobom what is the correct syntax please ?

Thanks for the answer.
Best regards, Alexandre.

admin

Number of posts: 557
Rank: admin •••

Profile of user
Response

Posted: 19.01.2019 [20:31]

Hello.

There is no support for utf8 with no BOM in PBE. You have to reopen your file via TMemoryStream, skip BOM and save the rest via another stream (TMemoryStream / TFileStream).

Roman

ouiouioui

Number of posts: 15
Rank: User

Profile of user
Response

Posted: 21.01.2019 [15:05]

Hello,

thanks for the answer. I write my file with BOM and strip it when load with php.
work well.

Thanks, best regards Alexandre.

New post to this topic

[.bold.]TEXT[./bold.]  [.italic.]TEXT[./italic.]  [.code.] TEXT [./code.]  [.quote.] TEXT [./quote.]

Number of topics: 373 • Number of posts: 1244 • Number of registered users: 62

Copyright © 2008-2021  Precision software & consulting. All rights reserved.
Send your comments to www pages.
Contact   |   RSS
Precision software & consulting
Narodnich mucedniku 447
738 01  Frydek-Mistek
Czech Republic