
    i)                     j    d Z ddlZddlZddlmZ ddlmZmZmZ dZ	dZ
dZdZdd	Zed
k(  r e        yy)z9
A command-line utility for fixing text found in a file.
    N)Union)TextFixerConfig__version__fix_filezftfy error:
Unfortunately, this output stream does not support Unicode.

Your system locale may be very old or misconfigured. You should use a locale
that supports UTF-8. One way to do this is to `export LANG=C.UTF-8`.
a  ftfy error:
Unfortunately, this output stream does not support Unicode.

You might be trying to output to the Windows Command Prompt (cmd.exe), which
does not fully support Unicode for historical reasons. In general, we recommend
finding a way to run Python without using cmd.exe.

You can work around this problem by using the '-o filename' option in ftfy to
output to a file instead.
a  ftfy error:
This input couldn't be decoded as %r. We got the following error:

    %s

ftfy works best when its input is in a known encoding. You can use `ftfy -g`
to guess, if you're desperate. Otherwise, give the encoding name with the
`-e` option, such as `ftfy -e latin-1`.
zUftfy error:
Can't read and write the same file. Please output to a new file instead.
c                     ddl } | j                  dt               }|j                  dddd	       |j                  d
dt        dd       |j                  dddd       |j                  ddt        dd       |j                  ddt        dd       |j                  ddd       |j                         }|j                  }|j                  rd}|j                  dk(  rt        j                  j                  }nt        |j                  d      }|j                  dk(  rt        j                  }nt        j                   j#                  |j                        t        j                   j#                  |j                        k(  r8t        j$                  j'                  t(               t        j*                  d       t        |j                  dd       }|j,                  }|j/                         d!k(  rd}|j0                  rd"}nd#}t3        ||$      }	 t5        |||%      D ]  }		 |j'                  |	        y# t6        $ rr t        j8                  d&k(  r$t        j$                  j'                  t:               n#t        j$                  j'                  t<               t        j*                  d       Y w xY w# t>        $ rG}
t        j$                  j'                  t@        ||
fz         t        j*                  d       Y d}
~
yd}
~
ww xY w)'z-
    Run ftfy as a command-line utility.
    r   Nz#ftfy (fixes text for you), version )descriptionfilename-?zMThe file whose Unicode is to be fixed. Defaults to -, meaning standard input.)defaultnargshelpz-oz--outputz>The file to output to. Defaults to -, meaning standard output.)typer   r   z-gz--guess
store_truezJAsk ftfy to guess the encoding of your input. This is risky. Overrides -e.)actionr   z-ez
--encodingzutf-8z-The encoding of the input. Defaults to UTF-8.z-nz--normalizationNFCzFThe normalization of Unicode to apply. Defaults to NFC. Can be "none".z--preserve-entitieszrLeave HTML entities as they are. The default is to decode them, as long as no HTML tags have appeared in the file.rb   w)encodingnoneFauto)unescape_htmlnormalization)r   configwin32)!argparseArgumentParserr   add_argumentstr
parse_argsr   guessr	   sysstdinbufferopenoutputstdoutospathrealpathstderrwriteSAME_FILE_ERROR_TEXTexitr   lowerpreserve_entitiesr   r   UnicodeEncodeErrorplatformENCODE_ERROR_TEXT_WINDOWSENCODE_ERROR_TEXT_UNIXUnicodeDecodeErrorDECODE_ERROR_TEXT)r   parserargsr   fileoutfiler   r   r   lineerrs              d/home/developers/rajanand/mypropertyqr-fmb-refixing-v2/venv/lib/python3.12/site-packages/ftfy/cli.pymainr?   ,   s    $$9+G % F \	   M   Y	   <   U   P   D}}Hzz}} yyDMM4({{c**77DKK(BGG,<,<T]],KKJJ12HHQKt{{C':&&M& =VFTHVD 	Dd#	 & <<7*JJ$$%>?JJ$$%;<  

*h_<=s=   J; )H=:J; =A8J85J; 7J88J; ;	L=LL__main__)returnN)__doc__r)   r#   typingr   ftfyr   r   r   r5   r4   r7   r.   r?   __name__     r>   <module>rH      sV    
 
  7 7 	   
^B zF rG   