Lazarus
Home
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Free Pascal
»
General
(Moderators:
FPK
,
Tomas Hajny
) »
[Solved] SetCodePage can raise an exception?
Free Pascal
Website
Downloads
Wiki
Documentation
Bugtracker
Mailing List
Lazarus
Website
Downloads (Laz+FPC)
Packages (OPM)
FAQ
Wiki
Documentation (RTL/FCL/LCL)
Bugtracker
CCR Bugs
IRC channel
GIT
Mailing List
Other languages
Foundation
Website
Useful Wiki Links
Project Roadmap
Getting the Source
Screenshots
How to use the forum
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
Recent
Problem with Lazarus icon...
by
wp
[
Today
at 10:14:26 am]
Get notified when monitor...
by
artem101
[
Today
at 09:49:13 am]
pdfium.dll loadfromfile f...
by
domasz
[
Today
at 09:45:22 am]
SQL - looks easy but I ca...
by
Zvoni
[
Today
at 09:40:57 am]
Code-Review Request: Alte...
by
Zvoni
[
Today
at 09:28:07 am]
How to display barcode co...
by
Jonvy
[
Today
at 07:12:55 am]
Examples of third-party p...
by
dbannon
[
Today
at 06:09:07 am]
Pasar punteros de DLL C a...
by
edgarrod71
[
Today
at 03:45:00 am]
WebLaz corrections
by
edgarrod71
[
Today
at 03:32:14 am]
Q: System code for Indy S...
by
Remy Lebeau
[
Today
at 02:10:57 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: [Solved] SetCodePage can raise an exception? (Read 215 times)
AlexTP
Hero Member
Posts: 2046
[Solved] SetCodePage can raise an exception?
«
on:
December 25, 2022, 12:35:20 pm »
SetCodePage calls fpc_AnsiStr_To_AnsiStr, I cannot find its code in 'fpcsrc' yet. Can it raise an exception (or set another error flag) on conversion error? I need that exception - my app wants to check is some encoding applicable to a file or not.
PS. I found the source - fpc_AnsiStr_To_AnsiStr calls widestringmanager methods. But I cannot find their src yet.
«
Last Edit: December 25, 2022, 01:05:15 pm by AlexTP
»
Logged
CudaText editor
-
ATSynEdit
-
More from me
Thaddy
Hero Member
Posts: 12933
Re: SetCodePage can raise an exception?
«
Reply #1 on:
December 25, 2022, 12:51:36 pm »
The sources for the default widestring manager are in rtl.
Logged
In memory of Gordon Moore (January 3, 1929 – March 24, 2023) Just double the heaven every two years from now.
Bart
Hero Member
Posts: 4934
Re: SetCodePage can raise an exception?
«
Reply #2 on:
December 25, 2022, 12:53:46 pm »
AFAICS by testing it will return an empty string if it cannot convert.
Bart
Logged
AlexTP
Hero Member
Posts: 2046
Re: SetCodePage can raise an exception?
«
Reply #3 on:
December 25, 2022, 01:05:03 pm »
Thanks, empty str is OK for me.
Logged
CudaText editor
-
ATSynEdit
-
More from me
Bart
Hero Member
Posts: 4934
Re: [Solved] SetCodePage can raise an exception?
«
Reply #4 on:
December 25, 2022, 01:10:41 pm »
Someone with more knowledge (an fpc devel) should confirm this.
My conclusion is based upon very limited testing!
Bart
Logged
Thaddy
Hero Member
Posts: 12933
Re: [Solved] SetCodePage can raise an exception?
«
Reply #5 on:
December 25, 2022, 01:24:36 pm »
I have the same conclusion as Bart, also after very limited testing, but I am not a devel.
Anyway, you can write your own exception handler if empty.
Logged
In memory of Gordon Moore (January 3, 1929 – March 24, 2023) Just double the heaven every two years from now.
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Free Pascal
»
General
(Moderators:
FPK
,
Tomas Hajny
) »
[Solved] SetCodePage can raise an exception?
TinyPortal
© 2005-2018